1 # ifndef CPPAD_UTILITY_TO_STRING_HPP
2 # define CPPAD_UTILITY_TO_STRING_HPP
108 # define CPPAD_SPECIALIZE_TO_STRING_INTEGER(Type) \
109 template <> struct to_string_struct<Type>\
110 { std::string operator()(const Type& value) \
111 { std::stringstream os;\
117 # define CPPAD_SPECIALIZE_TO_STRING_FLOAT(Float) \
118 template <> struct to_string_struct<Float>\
119 { std::string operator()(const Float& value) \
120 { std::stringstream os;\
121 int n_digits = 1 + std::numeric_limits<Float>::digits10;\
122 os << std::setprecision(n_digits);\
132 template <
class Type>
137 "to_string is not implemented for this type"
140 return std::string(
"");
154 # if CPPAD_USE_CPLUSPLUS_2011
168 return to_str(value);
172 # undef CPPAD_SPECIALIZE_TO_STRING_FLOAT
173 # undef CPPAD_SPECIALIZE_TO_STRING_INTEGER
#define CPPAD_ASSERT_KNOWN(exp, msg)
Check that exp is true, if not print msg and terminate execution.
#define CPPAD_SPECIALIZE_TO_STRING_INTEGER(Type)
Define the CppAD error checking macros (all of which begin with CPPAD_ASSERT_)
#define CPPAD_SPECIALIZE_TO_STRING_FLOAT(Float)
std::string to_string(const Type &value)
std::string operator()(const Type &value)