SXEval 1.0.3
A generic s-expression interpreter library.
Loading...
Searching...
No Matches
utils.hpp File Reference
#include <type_traits>
#include <cmath>
#include <stdexcept>
#include <cstdio>
#include <limits>

Go to the source code of this file.

Namespaces

namespace  sxeval
 

Macros

#define SXEVAL_PI   3.14159265358979323846
 

Functions

template<typename T >
T sxeval::StringToType (const std::string &s)
 Convert a string to a type T.
 
template<typename T >
bool sxeval::Greater (const T &a, const T &b)
 Check if a is greater than b.
 
template<typename T >
std::enable_if< std::is_integral< T >::value, bool >::type sxeval::Equal (const T &a, const T &b)
 Check if a is equal to b.
 
template<typename T >
std::enable_if< std::is_floating_point< T >::value, bool >::type sxeval::Equal (const T &a, const T &b)
 Check if a is equal to b.
 
template<typename T >
bool sxeval::NotEqual (const T &a, const T &b)
 Check if a is not equal to b.
 
template<typename T >
bool sxeval::GreaterOrEqual (const T &a, const T &b)
 Check if a is greater than or equal to b.
 
template<typename T >
bool sxeval::Less (const T &a, const T &b)
 Check if a is less than b.
 
template<typename T >
bool sxeval::LessOrEqual (const T &a, const T &b)
 Check if a is less than or equal to b.
 
template<typename T >
std::enable_if< std::is_integral< T >::value, bool >::type sxeval::TypeToBool (const T &val)
 Convert a type T to a boolean value.
 
template<typename T >
std::enable_if< std::is_floating_point< T >::value, bool >::type sxeval::TypeToBool (const T &val)
 Convert a type T to a boolean value.
 
template<typename T >
bool sxeval::LogicalAnd (const T &a, const T &b)
 Perform a logical and operations on types T.
 
template<typename T >
bool sxeval::LogicalOr (const T &a, const T &b)
 Perform a logical or operation on types T.
 
template<typename T >
bool sxeval::LogicalNot (const T &a)
 Perform a logical not operation on type T.
 
template<typename T >
bool sxeval::LogicalXor (const T &a, const T &b)
 Perform a logical xor operation on types T.
 
template<typename T >
bool sxeval::LogicalNand (const T &a, const T &b)
 Perform a logical nand operation on types T.
 
template<typename T >
bool sxeval::LogicalNor (const T &a, const T &b)
 Perform a logical nor operation on types T.
 
template<typename T >
bool sxeval::LogicalXnor (const T &a, const T &b)
 Perform a logical xnor operation on types T.
 
template<typename T >
std::enable_if< std::is_integral< T >::value, T >::type sxeval::Modulo (const T &a, const T &b)
 Perform a modulo operation on types T.
 
template<typename T >
std::enable_if< std::is_floating_point< T >::value, T >::type sxeval::Modulo (const T &a, const T &b)
 Perform a modulo operation on types T.
 
template<typename T >
std::enable_if< std::is_unsigned< T >::value, T >::type sxeval::Absolute (const T &a)
 Perform an absolute value operation on types T.
 
template<typename T >
std::enable_if< std::is_integral< T >::value &&!std::is_unsigned< T >::value, T >::type sxeval::Absolute (const T &a)
 Perform an absolute value operation on types T.
 
template<typename T >
std::enable_if< std::is_floating_point< T >::value &&!std::is_unsigned< T >::value, T >::type sxeval::Absolute (const T &a)
 Perform an absolute value operation on types T.
 

Macro Definition Documentation

◆ SXEVAL_PI

#define SXEVAL_PI   3.14159265358979323846