|
3 | 3 |
|
4 | 4 | namespace Rcpp{ |
5 | 5 |
|
6 | | - template <int N, int RTYPE> |
| 6 | + template <int N, int RTYPE, template <class> class StoragePolicy = PreserveStorage> |
7 | 7 | class Array { |
8 | 8 | public: |
9 | | - using Vec = Vector<RTYPE>; |
| 9 | + using Vec = Vector<RTYPE,StoragePolicy>; |
10 | 10 | using Proxy = typename Vec::Proxy; |
11 | | - using const_Proxy = typename Vec::Proxy; |
| 11 | + using const_Proxy = typename Vec::const_Proxy; |
12 | 12 |
|
13 | 13 | Array( SEXP x ) : index(), data(x) { |
14 | 14 | IntegerVector dim = data.attr("dim") ; |
@@ -53,14 +53,14 @@ namespace Rcpp{ |
53 | 53 | } ; |
54 | 54 |
|
55 | 55 |
|
56 | | - template <int N> using NumericArray = Array<N, REALSXP> ; |
57 | | - template <int N> using DoubleArray = Array<N, REALSXP> ; |
58 | | - template <int N> using IntegerArray = Array<N, INTSXP> ; |
59 | | - template <int N> using StringArray = Array<N, STRSXP> ; |
60 | | - template <int N> using CharacterArray = Array<N, STRSXP> ; |
61 | | - template <int N> using LogicalArray = Array<N, LGLSXP> ; |
62 | | - template <int N> using RawArray = Array<N, RAWSXP> ; |
63 | | - template <int N> using ComplexArray = Array<N, CPLXSXP> ; |
| 56 | + template <int N, template <class> class StoragePolicy = PreserveStorage> using NumericArray = Array<N, REALSXP, StoragePolicy> ; |
| 57 | + template <int N, template <class> class StoragePolicy = PreserveStorage> using DoubleArray = Array<N, REALSXP, StoragePolicy> ; |
| 58 | + template <int N, template <class> class StoragePolicy = PreserveStorage> using IntegerArray = Array<N, INTSXP , StoragePolicy> ; |
| 59 | + template <int N, template <class> class StoragePolicy = PreserveStorage> using StringArray = Array<N, STRSXP , StoragePolicy> ; |
| 60 | + template <int N, template <class> class StoragePolicy = PreserveStorage> using CharacterArray = Array<N, STRSXP , StoragePolicy> ; |
| 61 | + template <int N, template <class> class StoragePolicy = PreserveStorage> using LogicalArray = Array<N, LGLSXP , StoragePolicy> ; |
| 62 | + template <int N, template <class> class StoragePolicy = PreserveStorage> using RawArray = Array<N, RAWSXP , StoragePolicy> ; |
| 63 | + template <int N, template <class> class StoragePolicy = PreserveStorage> using ComplexArray = Array<N, CPLXSXP, StoragePolicy> ; |
64 | 64 |
|
65 | 65 | } // Rcpp |
66 | 66 |
|
|
0 commit comments