Skip to content

Commit 60c6284

Browse files
fix Matrix(no_init) constructor
1 parent 4680c31 commit 60c6284

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

inst/include/Rcpp/vector/Matrix.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ class Matrix : public Vector<RTYPE, StoragePolicy>, public MatrixBase<RTYPE, tru
8989
}
9090
Matrix& operator=( const SubMatrix<RTYPE>& ) ;
9191

92-
explicit Matrix( const no_init_matrix& obj) {
93-
VECTOR::set__( Rf_allocMatrix( RTYPE, obj.nrow(), obj.ncol() ) );
94-
}
92+
explicit Matrix( const no_init_matrix& obj) : VECTOR(Rf_allocMatrix(RTYPE, obj.nrow(), obj.ncol())), nrows(obj.nrow()) {}
9593

9694
inline int ncol() const {
9795
return VECTOR::dims()[1];

0 commit comments

Comments
 (0)