File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed
Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,28 @@ namespace Rcpp{
4747 }
4848
4949 template <typename T>
50- StretchyList_Impl& push_back (const T& obj ) ;
50+ inline StretchyList_Impl& push_back (const T& obj ){
51+ return push_back__impl ( obj, typename traits::is_named<T>::type () ) ;
52+ }
53+
54+ template <typename T>
55+ inline StretchyList_Impl& push_front (const T& obj ){
56+ return push_front__impl ( obj, typename traits::is_named<T>::type () ) ;
57+ }
58+
59+ private:
60+
61+ template <typename T>
62+ StretchyList_Impl& push_back__impl (const T& obj, traits::true_type ) ;
63+
64+ template <typename T>
65+ StretchyList_Impl& push_back__impl (const T& obj, traits::false_type ) ;
66+
67+ template <typename T>
68+ StretchyList_Impl& push_front__impl (const T& obj, traits::true_type ) ;
5169
5270 template <typename T>
53- StretchyList_Impl& push_front (const T& obj ) ;
71+ StretchyList_Impl& push_front__impl (const T& obj, traits::false_type ) ;
5472
5573 } ;
5674
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ namespace Rcpp{
2222
2323 template < template <class > class StoragePolicy >
2424 template < typename T>
25- StretchyList_Impl<StoragePolicy>& StretchyList_Impl<StoragePolicy>::push_back ( const T& obj){
25+ StretchyList_Impl<StoragePolicy>& StretchyList_Impl<StoragePolicy>::push_back__impl ( const T& obj, traits::false_type ){
2626 Shield<SEXP> s ( wrap (obj) ) ;
2727 SEXP tmp = Rf_cons ( s, R_NilValue );
2828 SEXP self = Storage::get__ () ;
@@ -33,7 +33,7 @@ namespace Rcpp{
3333
3434 template < template <class > class StoragePolicy >
3535 template < typename T>
36- StretchyList_Impl<StoragePolicy>& StretchyList_Impl<StoragePolicy>::push_front ( const T& obj){
36+ StretchyList_Impl<StoragePolicy>& StretchyList_Impl<StoragePolicy>::push_front__impl ( const T& obj, traits::false_type ){
3737 SEXP tmp ;
3838 SEXP self = Storage::get__ () ;
3939 Shield<SEXP> s ( wrap (obj) ) ;
You can’t perform that action at this time.
0 commit comments