LexicalConverter(const std::string &s, const Fmt &f): fmt(f), filled(true), buf(s) { }
const Fmt &get_fmt() const { return fmt; }
LexicalConverter(const std::string &s, const Fmt &f): fmt(f), filled(true), buf(s) { }
const Fmt &get_fmt() const { return fmt; }
void operator<<(LexicalConverter &, unsigned short);
void operator<<(LexicalConverter &, unsigned);
void operator<<(LexicalConverter &, unsigned long);
void operator<<(LexicalConverter &, unsigned short);
void operator<<(LexicalConverter &, unsigned);
void operator<<(LexicalConverter &, unsigned long);
void operator<<(LexicalConverter &, long long);
void operator<<(LexicalConverter &, unsigned long long);
void operator<<(LexicalConverter &, long long);
void operator<<(LexicalConverter &, unsigned long long);
void operator<<(LexicalConverter &, bool);
void operator<<(LexicalConverter &, float);
void operator<<(LexicalConverter &, double);
void operator<<(LexicalConverter &, bool);
void operator<<(LexicalConverter &, float);
void operator<<(LexicalConverter &, double);
void operator>>(const LexicalConverter &, unsigned short &);
void operator>>(const LexicalConverter &, unsigned int &);
void operator>>(const LexicalConverter &, unsigned long &);
void operator>>(const LexicalConverter &, unsigned short &);
void operator>>(const LexicalConverter &, unsigned int &);
void operator>>(const LexicalConverter &, unsigned long &);
void operator>>(const LexicalConverter &, long long &);
void operator>>(const LexicalConverter &, unsigned long long &);
void operator>>(const LexicalConverter &, long long &);
void operator>>(const LexicalConverter &, unsigned long long &);
void operator>>(const LexicalConverter &, bool &);
void operator>>(const LexicalConverter &, float &);
void operator>>(const LexicalConverter &, double &);
void operator>>(const LexicalConverter &, bool &);
void operator>>(const LexicalConverter &, float &);
void operator>>(const LexicalConverter &, double &);
- static T &v;
-
- /* The expression must depend on the template parameter, or the compiler
- will give an error. */
- template<typename U>
- static Yes f(int (*)[sizeof(s<<HasFormattedOutput<U>::v)]);
- template<typename U>
- static No f(...);
-
- enum { value = Evaluate<sizeof(f<T>(0))>::value };
+ template<typename T>
+ static Yes f(int (*)[sizeof(s<<reinterpret_cast<const T &>(s))]);
+ using Sfinae::f;
operator>>(const LexicalConverter &c, T &v)
{
std::istringstream ss(c.get());
ss.setf(std::ios_base::fmtflags(0), std::ios_base::skipws);
operator>>(const LexicalConverter &c, T &v)
{
std::istringstream ss(c.get());
ss.setf(std::ios_base::fmtflags(0), std::ios_base::skipws);
static std::string cast(const F &v, const Fmt &f = Fmt())
{
LexicalConverter conv(f);
static std::string cast(const F &v, const Fmt &f = Fmt())
{
LexicalConverter conv(f);
static std::string cast(const std::string &v, const Fmt &f = Fmt())
{
LexicalConverter conv(f);
static std::string cast(const std::string &v, const Fmt &f = Fmt())
{
LexicalConverter conv(f);