Rcpp Version 1.1.2
Loading...
Searching...
No Matches
safe_math.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Rcpp
 Rcpp API.
namespace  Rcpp::sugar
namespace  Rcpp::sugar::detail

Macros

#define safe_math__has_builtin(x)
#define RCPP_SAFE_ADD(a, b)
#define RCPP_SAFE_SUB(a, b)
#define RCPP_SAFE_MUL(a, b)

Functions

void Rcpp::sugar::detail::stop_overflow (const char *caller)
template<typename T>
std::enable_if< std::is_integral< T >::value, T >::type Rcpp::sugar::detail::safe_add (T a, T b, const char *caller=nullptr)
template<typename T>
std::enable_if<!std::is_integral< T >::value, T >::type Rcpp::sugar::detail::safe_add (T a, T b, const char *caller=nullptr)
template<typename T>
std::enable_if< std::is_integral< T >::value, T >::type Rcpp::sugar::detail::safe_sub (T a, T b, const char *caller=nullptr)
template<typename T>
std::enable_if<!std::is_integral< T >::value, T >::type Rcpp::sugar::detail::safe_sub (T a, T b, const char *caller=nullptr)
template<typename T>
std::enable_if< std::is_integral< T >::value, T >::type Rcpp::sugar::detail::safe_mul (T a, T b, const char *caller=nullptr)
template<typename T>
std::enable_if<!std::is_integral< T >::value, T >::type Rcpp::sugar::detail::safe_mul (T a, T b, const char *caller=nullptr)

Macro Definition Documentation

◆ RCPP_SAFE_ADD

◆ RCPP_SAFE_MUL

#define RCPP_SAFE_MUL ( a,
b )
Value:
std::enable_if< std::is_integral< T >::value, T >::type safe_mul(T a, T b, const char *caller=nullptr)
Definition safe_math.h:102

Definition at line 35 of file safe_math.h.

Referenced by Rcpp::sugar::Cumprod< RTYPE, NA, T >::get(), Rcpp::sugar::Times_Vector_Primitive< RTYPE, NA, T >::operator[](), and Rcpp::sugar::Times_Vector_Vector< RTYPE, LHS_NA, LHS_T, RHS_NA, RHS_T >::operator[]().

◆ RCPP_SAFE_SUB

◆ safe_math__has_builtin

#define safe_math__has_builtin ( x)
Value:
0

Definition at line 29 of file safe_math.h.