22 #ifndef Rcpp__sugar__sapply_h
23 #define Rcpp__sugar__sapply_h
25 #if defined(RCPP_USING_CXX0X_OR_LATER)
26 #include <type_traits>
32 template <
typename Function,
typename SugarExpression>
35 #if defined(RCPP_USING_CXX0X_OR_LATER)
36 typedef typename ::std::result_of<
Function(
typename SugarExpression::stored_type)>
::type type;
38 typedef typename ::Rcpp::traits::result_of<Function>::type
type;
45 template <
int RTYPE,
bool NA,
typename T,
typename Function,
bool NO_CONVERSION>
47 Rcpp::traits::r_sexptype_traits<
48 typename ::Rcpp::sugar::sapply_application_result_of<Function, T>::type
51 Sapply<RTYPE,NA,T,Function,NO_CONVERSION>
54 typedef typename ::Rcpp::sugar::sapply_application_result_of<Function, T>::type
result_type ;
73 inline R_xlen_t
size()
const {
return vec.size() ; }
82 template <
int RTYPE,
bool NA,
typename T,
typename Function>
84 Rcpp::traits::r_sexptype_traits<
85 typename ::Rcpp::sugar::sapply_application_result_of<Function, T>::type
88 Sapply<RTYPE,NA,T,Function,true>
91 typedef typename ::Rcpp::sugar::sapply_application_result_of<Function, T>::type
result_type ;
107 inline R_xlen_t
size()
const {
return vec.size() ; }
118 template <
int RTYPE,
bool NA,
typename T,
typename Function >
122 typename ::Rcpp::sugar::sapply_application_result_of<Function, T>::type ,
129 typename ::Rcpp::sugar::sapply_application_result_of<Function, T>::type ,
131 >::value >( t, fun ) ;
Sapply< RTYPE, NA, T, Function, NO_CONVERSION > & get_ref()
static target get(const T &input)
Rcpp::traits::storage_type< RESULT_R_TYPE >::type STORAGE
Rcpp::VectorBase< RTYPE, NA, T > VEC
::Rcpp::sugar::sapply_application_result_of< Function, T >::type result_type
Rcpp::traits::Extractor< RTYPE, NA, T >::type EXT
STORAGE operator[](R_xlen_t i) const
Sapply(const VEC &vec_, Function fun_)
::Rcpp::sugar::sapply_application_result_of< Function, T >::type result_type
Rcpp::VectorBase< RTYPE, NA, T > VEC
static const int RESULT_R_TYPE
Rcpp::traits::storage_type< RESULT_R_TYPE >::type STORAGE
Rcpp::traits::Extractor< RTYPE, NA, T >::type EXT
Rcpp::traits::r_vector_element_converter< RESULT_R_TYPE >::type converter_type
STORAGE operator[](R_xlen_t i) const
Sapply(const VEC &vec_, Function fun_)
#define RCPP_DEBUG_1(fmt, MSG)
#define DEMANGLE(__TYPE__)
Function_Impl< PreserveStorage > Function
sugar::Sapply< RTYPE, NA, T, Function, traits::same_type< typename ::Rcpp::sugar::sapply_application_result_of< Function, T >::type, typename Rcpp::traits::storage_type< traits::r_sexptype_traits< typename ::Rcpp::sugar::sapply_application_result_of< Function, T >::type >::rtype >::type >::value > sapply(const Rcpp::VectorBase< RTYPE, NA, T > &t, Function fun)
::Rcpp::traits::result_of< Function >::type type