Skip to content

Commit 752c2cf

Browse files
const no_init conversion operator
1 parent 5aa46bf commit 752c2cf

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

inst/include/Rcpp/internal/Exporter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
namespace Rcpp{
2626
namespace traits{
2727

28-
template <typename T> class Exporter{
28+
template <typename T>
29+
class Exporter{
2930
public:
3031
Exporter( SEXP x ) : t(x){}
3132
inline T get(){ return t ; }

inst/include/Rcpp/proxy/AttributeProxy.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ class AttributeProxyPolicy {
3131
{}
3232

3333
AttributeProxy& operator=(const AttributeProxy& rhs){
34-
if( *this != rhs ) set( rhs.get() ) ;
34+
if( this != &rhs ) set( rhs.get() ) ;
3535
return *this ;
3636
}
3737

3838
template <typename T> AttributeProxy& operator=(const T& rhs) ;
3939

4040
template <typename T> operator T() const ;
41+
4142
inline operator SEXP() const {
4243
return get() ;
4344
}

inst/include/Rcpp/vector/Vector.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ class Vector :
6868
return Storage::copy__(rhs) ;
6969
}
7070

71-
// we can't define these 3 in meat for some reason
72-
// maybe because of the typedef in instantiation.h
7371
Vector( SEXP x ) {
7472
Storage::set__(x) ;
7573
}

inst/include/Rcpp/vector/no_init.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class no_init {
3333
}
3434

3535
template <int RTYPE, template <class> class StoragePolicy >
36-
operator Vector<RTYPE, StoragePolicy>(){
36+
operator Vector<RTYPE, StoragePolicy>() const {
3737
return Rf_allocVector(RTYPE, size) ;
3838
}
3939

0 commit comments

Comments
 (0)