| 27 | |
| 28 | template <typename InputIterator, typename KEY, typename VALUE, int RTYPE> |
| 29 | inline SEXP range_wrap_dispatch___impl__pair( InputIterator first, InputIterator last, Rcpp::traits::true_type ){ |
| 30 | RCPP_DEBUG_3( "range_wrap_dispatch___impl__pair<KEY = %s, VALUE = %s, RTYPE = %d>\n", DEMANGLE(KEY), DEMANGLE(VALUE), RTYPE) |
| 31 | R_xlen_t size = std::distance( first, last ) ; |
| 32 | //typedef typename Rcpp::traits::storage_type<RTYPE>::type STORAGE ; |
| 33 | |
| 34 | CharacterVector names(size) ; |
| 35 | Vector<RTYPE> x(size) ; |
| 36 | Rcpp::String buffer ; |
| 37 | for( R_xlen_t i = 0; i < size ; i++, ++first){ |
| 38 | buffer = first->first ; |
| 39 | x[i] = first->second ; |
| 40 | names[i] = buffer ; |
| 41 | } |
| 42 | x.attr( "names" ) = names ; |
| 43 | return x ; |
| 44 | } |
| 45 | |
| 46 | template <typename InputIterator, typename KEY, typename VALUE, int RTYPE> |
| 47 | inline SEXP range_wrap_dispatch___impl__pair( InputIterator first, InputIterator last, Rcpp::traits::false_type ){ |