46 #ifndef LIB_FORMAT_OBJ_H 47 #define LIB_FORMAT_OBJ_H 52 #include <boost/lexical_cast.hpp> 60 template<
typename C,
class _TRAITS>
63 using ostream = basic_ostream<char, char_traits<char>>;
86 std::string showDouble (
double) noexcept;
87 std::string showFloat (
float) noexcept;
88 std::string showSize (
size_t) noexcept;
89 std::string showAddr (
void const* addr) noexcept;
92 std::ostream& showAddr (std::ostream&,
void const* addr);
95 std::string showHash (
size_t hash, uint showBytes=8) noexcept;
98 showHashLSB (
size_t hash) noexcept
100 return showHash(hash,1);
103 std::string showDecimal (
double) noexcept;
104 std::string showDecimal (
float) noexcept;
105 std::string showDecimal (f128) noexcept;
106 std::string showComplete (
double)noexcept;
107 std::string showComplete (
float) noexcept;
108 std::string showComplete (f128) noexcept;
117 template<
typename SP>
130 invoke (X
const& val) noexcept
131 try {
return boost::lexical_cast<std::string> (val); }
132 catch(...) {
return FAILURE_INDICATOR; }
135 template<
typename SP>
139 invoke (SP
const& smP) noexcept
141 catch(...) {
return FAILURE_INDICATOR; }
154 invoke (
double val) noexcept
163 invoke (
float val) noexcept
165 return util::showFloat (val);
172 invoke (
bool val) noexcept
198 template<
typename TY>
202 using PlainVal =
typename lib::meta::Strip<TY>::TypeReferred;
212 template<
typename TY>
217 return 0 == repr.rfind(
"«", 0)? repr
218 :
"«"+typeStr(val)+
"»|"+repr;
221 {
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.