37 #ifndef LIB_FORMAT_OBJ_H 38 #define LIB_FORMAT_OBJ_H 43 #include <boost/lexical_cast.hpp> 51 template<
typename C,
class _TRAITS>
54 using ostream = basic_ostream<char, char_traits<char>>;
77 std::string showDouble (
double) noexcept;
78 std::string showFloat (
float) noexcept;
79 std::string showSize (
size_t) noexcept;
80 std::string showAdr (
void const* addr) noexcept;
83 std::ostream& showAdr (std::ostream&,
void const* addr);
86 std::string showHash (
size_t hash, uint showBytes=8) noexcept;
89 showHashLSB (
size_t hash) noexcept
91 return showHash(hash,1);
94 std::string showDecimal (
double) noexcept;
95 std::string showDecimal (
float) noexcept;
96 std::string showDecimal (f128) noexcept;
97 std::string showComplete (
double)noexcept;
98 std::string showComplete (
float) noexcept;
99 std::string showComplete (f128) noexcept;
108 template<
typename SP>
121 invoke (X
const& val) noexcept
122 try {
return boost::lexical_cast<std::string> (val); }
123 catch(...) {
return FAILURE_INDICATOR; }
126 template<
typename SP>
130 invoke (SP
const& smP) noexcept
132 catch(...) {
return FAILURE_INDICATOR; }
145 invoke (
double val) noexcept
154 invoke (
float val) noexcept
156 return util::showFloat (val);
163 invoke (
bool val) noexcept
189 template<
typename TY>
193 using PlainVal =
typename lib::meta::Strip<TY>::TypeReferred;
203 template<
typename TY>
208 return 0 == repr.rfind(
"«", 0)? repr
209 :
"«"+typeStr(val)+
"»|"+repr;
212 {
return FAILURE_INDICATOR; }
inline string literal This is a marker type to indicate that
Primary class template for std::hash.
Implementation namespace for support and library code.
Marker types to indicate a literal string and a Symbol.
Helpers for type detection, type rewriting and metaprogramming.
string typeSymbol()
Short readable type identifier, not necessarily unique or complete.
failsafe invocation of custom string conversion.