[Rcpp-commits] r596 - pkg/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Feb 6 15:11:42 CET 2010
Author: romain
Date: 2010-02-06 15:11:41 +0100 (Sat, 06 Feb 2010)
New Revision: 596
Modified:
pkg/src/RcppSexp.h
Log:
updated to used as<Foo> directly rather than the asFoo methods to anticipate api cleaning of RObject
Modified: pkg/src/RcppSexp.h
===================================================================
--- pkg/src/RcppSexp.h 2010-02-06 13:45:29 UTC (rev 595)
+++ pkg/src/RcppSexp.h 2010-02-06 14:11:41 UTC (rev 596)
@@ -67,18 +67,17 @@
/* we don't provide implicit converters because
of Item 5 in More Effective C++ */
- inline bool asBool() const {return object.asBool() ; } ;
- inline double asDouble() const { return object.asDouble() ; }
- inline int asInt() const { return object.asInt() ; }
- inline Rbyte asRaw() const { return object.asRaw() ; }
- inline std::string asStdString() const { return object.asStdString() ; }
- inline std::vector<int> asStdVectorInt() const { return object.asStdVectorInt() ; }
- inline std::vector<double> asStdVectorDouble() const { return object.asStdVectorDouble(); }
- inline std::vector<std::string> asStdVectorString() const { return object.asStdVectorString(); }
- inline std::vector<Rbyte> asStdVectorRaw() const { return object.asStdVectorRaw() ;}
- inline std::vector<bool> asStdVectorBool() const { return object.asStdVectorBool() ; }
+ inline bool asBool() const {return as<bool>( object ) ; } ;
+ inline double asDouble() const { return as<double>(object) ; }
+ inline int asInt() const { return as<int>(object) ; }
+ inline Rbyte asRaw() const { return as<Rbyte>(object) ; }
+ inline std::string asStdString() const { return as<std::string>(object) ; }
+ inline std::vector<int> asStdVectorInt() const { return as< std::vector<int> >( object ) ; }
+ inline std::vector<double> asStdVectorDouble() const { return as< std::vector<double>(object); }
+ inline std::vector<std::string> asStdVectorString() const { return as< std::vector<std::string> >(object); }
+ inline std::vector<Rbyte> asStdVectorRaw() const { return as< std::vector<Rbyte> >(object) ;}
+ inline std::vector<bool> asStdVectorBool() const { return as< std::vector<bool> >(object) ; }
-
/**
* Calls the preserve method of the wrapped RObject, which
* prevents the underlying SEXP from being garbage collected
More information about the Rcpp-commits
mailing list