22#ifndef Rcpp__sugar__sign_h
23#define Rcpp__sugar__sign_h
28template <
bool NA,
int RTYPE>
33 return Rcpp::traits::is_na<RTYPE>(x) ?
NA_INTEGER : ( x > 0 ? 1 : (x==0 ? 0 : -1) ) ;
42 return ( x > 0 ? 1 : (x==0 ? 0 : -1) ) ;
47template <
int RTYPE,
bool NA,
typename T>
61 operator SEXP()
const {
return wrap( *
this ); }
69template <
bool NA,
typename T>
74template <
bool NA,
typename T>
int operator[](R_xlen_t i) const
int get(R_xlen_t i) const
Sign(const VEC_TYPE &object_)
Rcpp::VectorBase< RTYPE, NA, T > VEC_TYPE
Rcpp::traits::storage_type< RTYPE >::type STORAGE
Rcpp::traits::storage_type< RTYPE >::type STORAGE
static int get(STORAGE x)
Rcpp::traits::storage_type< RTYPE >::type STORAGE
static int get(STORAGE x)
sugar::Sign< INTSXP, NA, T > sign(const VectorBase< INTSXP, NA, T > &t)
SEXP wrap(const Date &date)