42 return obj ? std::string(
"TRUE") : std::string(
"FALSE");
50 return std::string(obj);
53 #if __GNUC__ > 4 || defined(__clang__) 58 template<typename T, typename std::enable_if<!sfinae::exists_to_string<T>::value,
int>::type = 0>
60 std::ostringstream stream;
70 std::ostringstream stream;
80 std::string
to_string(
const T& obj,
const long _precision) {
81 std::ostringstream stream;
82 stream.precision(_precision);
83 stream << std::fixed << obj;
94 std::stringstream stream(_s);
XERUS_force_inline double from_string< double >(const std::string &_str)
XERUS_force_inline unsigned long long from_string< unsigned long long >(const std::string &_str)
The main namespace of xerus.
XERUS_force_inline float from_string< float >(const std::string &_str)
T from_string(const std::string &_s)
: Creates an arbitary Object from string
XERUS_force_inline unsigned long from_string< unsigned long >(const std::string &_str)
Header file for macros that encapsulate SFINAE functionality.
std::string to_string(const T &obj, const long _precision)
: Converts an arbitary Object to string with fixed precision
Header file for the standard container to standard ostream operators.
XERUS_force_inline int from_string< int >(const std::string &_str)
XERUS_force_inline long double from_string< long double >(const std::string &_str)
static XERUS_force_inline std::string to_string(const bool obj)
XERUS_force_inline long long from_string< long long >(const std::string &_str)
XERUS_force_inline long from_string< long >(const std::string &_str)
#define XERUS_force_inline
Collection of attributes to force gcc to inline a specific function.
Header file for global shorthand notations of elementary integer types and attribute lists...