@@ -539,12 +539,14 @@ namespace classdesc
539
539
is_class<T>,
540
540
Not<is_container<T>>,
541
541
Not<is_smart_ptr<T>>,
542
- Not<is_string<T>>
542
+ Not<is_string<T>>,
543
+ Not<is_excluded<T>>
543
544
> {};
544
545
545
546
546
547
template <class T >
547
- void RESTProcessp (RESTProcess_t& repo, const string& d, Exclude<T>& a)
548
+ typename enable_if<is_excluded<T>,void >::T
549
+ RESTProcessp (RESTProcess_t& repo, const string& d, T& a)
548
550
{}
549
551
550
552
template <class T >
@@ -658,7 +660,8 @@ namespace classdesc
658
660
erase(U& o,typename U::iterator i) {o.erase (i);}
659
661
660
662
template <class U >
661
- void erase (U& o,typename U::const_iterator i) {}
663
+ typename enable_if<Not<is_same<typename U::iterator,typename U::const_iterator>>,void >::T
664
+ erase (U& o,typename U::const_iterator i) {}
662
665
663
666
template <class U >
664
667
typename enable_if<Not<has_member_erase<U,typename U::iterator (U::*)(typename U::const_iterator)>>,void>::T
@@ -714,6 +717,12 @@ namespace classdesc
714
717
RESTProcessValueSequence (Args&&... args): RESTProcessSequence<T>(actual), actual(std::forward<Args>(args)...) {}
715
718
};
716
719
720
+ template <class T , int R> RPPtr copyMultiArrayIterator (MultiArray<T,R>& x);
721
+ template <class T , int R> RPPtr copyMultiArrayIterator (const MultiArray<T,R>& x);
722
+
723
+ template <class T > RPPtr copyMultiArrayIterator (T& x)
724
+ {return std::make_shared<RESTProcessObject<T>>(x);}
725
+
717
726
template <class T > struct RESTProcessMultiArray : public RESTProcessBase
718
727
{
719
728
T actual;
@@ -732,7 +741,7 @@ namespace classdesc
732
741
RPPtr getElem (const REST_PROCESS_BUFFER& index) override {
733
742
size_t idx; index >>idx;
734
743
if (idx<actual.size ())
735
- return std::make_shared<RESTProcessMultiArray< typename T::value_type>> (actual[idx]);
744
+ return copyMultiArrayIterator (actual[idx]);
736
745
return std::make_shared<RESTProcessVoid>();
737
746
}
738
747
RPPtr setElem (const REST_PROCESS_BUFFER& index, const REST_PROCESS_BUFFER& value) override {
@@ -741,13 +750,18 @@ namespace classdesc
741
750
{
742
751
auto elem=actual[idx];
743
752
convert (elem,value);
744
- return std::make_shared<RESTProcessMultiArray< typename T::value_type>> (elem);
753
+ return copyMultiArrayIterator (elem);
745
754
}
746
755
return std::make_shared<RESTProcessVoid>();
747
756
}
748
757
size_t size () const override {return actual.size ();}
749
758
};
750
759
760
+ template <class T , int R> RPPtr copyMultiArrayIterator (MultiArray<T,R>& x)
761
+ {return std::make_shared<RESTProcessMultiArray<MultiArray<T,R>>>(x);}
762
+ template <class T , int R> RPPtr copyMultiArrayIterator (const MultiArray<T,R>& x)
763
+ {return std::make_shared<RESTProcessMultiArray<MultiArray<T,R>>>(x);}
764
+
751
765
template <class T > struct RESTProcessMultiArray <classdesc::MultiArray<T,1 >>:
752
766
public RESTProcessSequence<classdesc::MultiArray<T,1 >>
753
767
{
0 commit comments