Skip to content

Commit ff56143

Browse files
using StoragePolicy in Array. closes #107
1 parent 758bdfa commit ff56143

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

inst/include/Rcpp/Array.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
namespace Rcpp{
55

6-
template <int N, int RTYPE>
6+
template <int N, int RTYPE, template <class> class StoragePolicy = PreserveStorage>
77
class Array {
88
public:
9-
using Vec = Vector<RTYPE>;
9+
using Vec = Vector<RTYPE,StoragePolicy>;
1010
using Proxy = typename Vec::Proxy;
11-
using const_Proxy = typename Vec::Proxy;
11+
using const_Proxy = typename Vec::const_Proxy;
1212

1313
Array( SEXP x ) : index(), data(x) {
1414
IntegerVector dim = data.attr("dim") ;
@@ -53,14 +53,14 @@ namespace Rcpp{
5353
} ;
5454

5555

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> ;
6464

6565
} // Rcpp
6666

0 commit comments

Comments
 (0)