File tree Expand file tree Collapse file tree 6 files changed +30
-17
lines changed Expand file tree Collapse file tree 6 files changed +30
-17
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ class Proxy_Iterator {
81
81
}
82
82
83
83
inline reference operator *() {
84
- return proxy ;
84
+ return proxy ;
85
85
}
86
86
inline pointer operator ->(){
87
87
return &proxy ;
Original file line number Diff line number Diff line change @@ -936,6 +936,7 @@ class Vector :
936
936
}
937
937
938
938
R_xlen_t n = size () ;
939
+
939
940
Vector target ( n - 1 ) ;
940
941
iterator target_it (target.begin ()) ;
941
942
iterator it (begin ()) ;
Original file line number Diff line number Diff line change @@ -31,17 +31,26 @@ namespace internal{
31
31
generic_proxy (): parent(0 ), index(-1 ){}
32
32
33
33
generic_proxy ( const generic_proxy& other ) :
34
- parent (other.parent), index(other.index){} ;
34
+ parent (other.parent), index(other.index)
35
+ {}
35
36
36
- generic_proxy ( VECTOR& v, R_xlen_t i ) : parent(&v), index(i){} ;
37
+ generic_proxy ( VECTOR& v, R_xlen_t i ) :
38
+ parent (&v), index(i)
39
+ {}
37
40
38
41
generic_proxy& operator =(SEXP rhs) {
39
42
set (rhs) ;
40
43
return *this ;
41
44
}
42
45
43
- generic_proxy& operator =(const generic_proxy& rhs) {
44
- set (rhs.get ());
46
+ generic_proxy& operator =(const generic_proxy& rhs){
47
+ set (rhs.get ());
48
+ return *this ;
49
+ }
50
+
51
+ template <template <class > class StoragePolicy2 >
52
+ generic_proxy& operator =(const generic_proxy<RTYPE,StoragePolicy2>& rhs) {
53
+ set (rhs.get ());
45
54
return *this ;
46
55
}
47
56
@@ -78,13 +87,15 @@ namespace internal{
78
87
index = other.index ;
79
88
}
80
89
90
+ inline SEXP get () const {
91
+ return VECTOR_ELT (*parent, index );
92
+ }
93
+
81
94
private:
82
95
inline void set (SEXP x) {
83
96
SET_VECTOR_ELT ( *parent, index, x ) ;
84
97
}
85
- inline SEXP get () const {
86
- return VECTOR_ELT (*parent, index );
87
- }
98
+
88
99
89
100
} ;
90
101
Original file line number Diff line number Diff line change @@ -222,11 +222,11 @@ namespace traits {
222
222
} ;
223
223
template <template <class > class StoragePolicy >
224
224
struct r_vector_proxy <EXPRSXP, StoragePolicy> {
225
- typedef ::Rcpp::internal::generic_proxy<EXPRSXP> type ;
225
+ typedef ::Rcpp::internal::generic_proxy<EXPRSXP, StoragePolicy > type ;
226
226
} ;
227
227
template <template <class > class StoragePolicy >
228
228
struct r_vector_proxy <VECSXP, StoragePolicy> {
229
- typedef ::Rcpp::internal::generic_proxy<VECSXP> type ;
229
+ typedef ::Rcpp::internal::generic_proxy<VECSXP, StoragePolicy > type ;
230
230
} ;
231
231
232
232
template <int RTYPE, template <class > class StoragePolicy >
Original file line number Diff line number Diff line change @@ -53,9 +53,10 @@ namespace internal{
53
53
*
54
54
* @param rhs another proxy, possibly from another vector
55
55
*/
56
- string_proxy& operator =(const string_proxy& other){
57
- set ( other.get () ) ;
58
- return *this ;
56
+ template <template <class > class StoragePolicy2 >
57
+ string_proxy& operator =( const string_proxy<RTYPE, StoragePolicy2>& other) {
58
+ set ( other.get () ) ;
59
+ return *this ;
59
60
}
60
61
61
62
template <template <class > class StoragePolicy2 >
Original file line number Diff line number Diff line change @@ -55,8 +55,8 @@ namespace traits{
55
55
class proxy_cache {
56
56
public:
57
57
typedef typename ::Rcpp::Vector<RTYPE, StoragePolicy> VECTOR ;
58
- typedef typename r_vector_iterator<RTYPE>::type iterator ;
59
- typedef typename r_vector_const_iterator<RTYPE>::type const_iterator ;
58
+ typedef typename r_vector_iterator<RTYPE, StoragePolicy >::type iterator ;
59
+ typedef typename r_vector_const_iterator<RTYPE, StoragePolicy >::type const_iterator ;
60
60
typedef typename r_vector_proxy<RTYPE, StoragePolicy>::type proxy ;
61
61
typedef typename r_vector_const_proxy<RTYPE, StoragePolicy>::type const_proxy ;
62
62
@@ -75,8 +75,8 @@ namespace traits{
75
75
inline const_proxy ref () const { return const_proxy (*p,0 ) ; }
76
76
inline const_proxy ref (R_xlen_t i) const { return const_proxy (*p,i);}
77
77
78
- private:
79
- VECTOR* p ;
78
+ private:
79
+ VECTOR* p ;
80
80
} ;
81
81
82
82
// regular types for INTSXP, REALSXP, ...
You can’t perform that action at this time.
0 commit comments