Permalink
Browse files

Work around some holes in the BitmaskType specification

  • Loading branch information...
mniip committed May 8, 2018
1 parent d404f4a commit deaa17a947f8dcb4261975d97cb45f5bd9dd88d9
Showing with 12 additions and 8 deletions.
  1. +7 −7 src/common/Format.h
  2. +5 −1 src/common/String.h
@@ -118,21 +118,21 @@ namespace Format
template<typename T> inline FlagsOverride<T, std::ios_base::uppercase, std::ios_base::uppercase> Uppercase(T value) { return FlagsOverride<T, std::ios_base::uppercase, std::ios_base::uppercase>(value); }
template<typename T> inline FlagsOverride<T, std::ios_base::showpoint, std::ios_base::showpoint> ShowPoint(T value) { return FlagsOverride<T, std::ios_base::showpoint, std::ios_base::showpoint>(value); }
template<typename T> inline FlagsOverride<T, std::ios_base::fmtflags{}, std::ios_base::uppercase> NoUppercase(T value) { return FlagsOverride<T, std::ios_base::fmtflags{}, std::ios_base::uppercase>(value); }
template<typename T> inline FlagsOverride<T, std::ios_base::fmtflags{}, std::ios_base::showpoint> NoShowPoint(T value) { return FlagsOverride<T, std::ios_base::fmtflags{}, std::ios_base::showpoint>(value); }
template<typename T> inline FlagsOverride<T, EmptyFmtFlags, std::ios_base::uppercase> NoUppercase(T value) { return FlagsOverride<T, EmptyFmtFlags, std::ios_base::uppercase>(value); }
template<typename T> inline FlagsOverride<T, EmptyFmtFlags, std::ios_base::showpoint> NoShowPoint(T value) { return FlagsOverride<T, EmptyFmtFlags, std::ios_base::showpoint>(value); }
inline FlagsOverride<void, std::ios_base::uppercase, std::ios_base::uppercase> Uppercase() { return FlagsOverride<void, std::ios_base::uppercase, std::ios_base::uppercase>(); }
inline FlagsOverride<void, std::ios_base::showpoint, std::ios_base::showpoint> ShowPoint() { return FlagsOverride<void, std::ios_base::showpoint, std::ios_base::showpoint>(); }
inline FlagsOverride<void, std::ios_base::skipws, std::ios_base::skipws> SkipWS() { return FlagsOverride<void, std::ios_base::skipws, std::ios_base::skipws>(); }
inline FlagsOverride<void, std::ios_base::fmtflags{}, std::ios_base::uppercase> NoUppercase() { return FlagsOverride<void, std::ios_base::fmtflags{}, std::ios_base::uppercase>(); }
inline FlagsOverride<void, std::ios_base::fmtflags{}, std::ios_base::showpoint> NoShowPoint() { return FlagsOverride<void, std::ios_base::fmtflags{}, std::ios_base::showpoint>(); }
inline FlagsOverride<void, std::ios_base::fmtflags{}, std::ios_base::skipws> NoSkipWS() { return FlagsOverride<void, std::ios_base::fmtflags{}, std::ios_base::skipws>(); }
inline FlagsOverride<void, EmptyFmtFlags, std::ios_base::uppercase> NoUppercase() { return FlagsOverride<void, EmptyFmtFlags, std::ios_base::uppercase>(); }
inline FlagsOverride<void, EmptyFmtFlags, std::ios_base::showpoint> NoShowPoint() { return FlagsOverride<void, EmptyFmtFlags, std::ios_base::showpoint>(); }
inline FlagsOverride<void, EmptyFmtFlags, std::ios_base::skipws> NoSkipWS() { return FlagsOverride<void, EmptyFmtFlags, std::ios_base::skipws>(); }
template<typename T> inline FlagsOverride<T, std::ios_base::fixed, std::ios_base::floatfield> Fixed(T value) { return FlagsOverride<T, std::ios_base::fixed, std::ios_base::floatfield>(value); }
template<typename T> inline FlagsOverride<T, std::ios_base::scientific, std::ios_base::floatfield> Scientific(T value) { return FlagsOverride<T, std::ios_base::scientific, std::ios_base::floatfield>(value); }
template<typename T> inline FlagsOverride<T, std::ios_base::fmtflags{}, std::ios_base::floatfield> FloatDefault(T value) { return FlagsOverride<T, std::ios_base::fmtflags{}, std::ios_base::floatfield>(value); }
template<typename T> inline FlagsOverride<T, EmptyFmtFlags, std::ios_base::floatfield> FloatDefault(T value) { return FlagsOverride<T, EmptyFmtFlags, std::ios_base::floatfield>(value); }
inline FlagsOverride<void, std::ios_base::fixed, std::ios_base::floatfield> Fixed() { return FlagsOverride<void, std::ios_base::fixed, std::ios_base::floatfield>(); }
inline FlagsOverride<void, std::ios_base::scientific, std::ios_base::floatfield> Scientific() { return FlagsOverride<void, std::ios_base::scientific, std::ios_base::floatfield>(); }
inline FlagsOverride<void, std::ios_base::fmtflags{}, std::ios_base::floatfield> FloatDefault() { return FlagsOverride<void, std::ios_base::fmtflags{}, std::ios_base::floatfield>(); }
inline FlagsOverride<void, EmptyFmtFlags, std::ios_base::floatfield> FloatDefault() { return FlagsOverride<void, EmptyFmtFlags, std::ios_base::floatfield>(); }
template<typename T> inline FillOverride<T> Fill(T value, String::value_type fill) { return FillOverride<T>(value, fill); }
template<typename T> inline WidthOverride<T> Width(T value, size_t width) { return WidthOverride<T>(value, width); }
@@ -164,7 +164,11 @@
class ByteStringBuilder;
class String;
class StringBuilder;
namespace Format { template<typename T, std::ios_base::fmtflags set, std::ios_base::fmtflags reset> struct FlagsOverride; }
namespace Format
{
const std::ios_base::fmtflags EmptyFmtFlags = std::ios_base::dec & ~std::ios_base::dec;
template<typename T, std::ios_base::fmtflags set, std::ios_base::fmtflags reset> struct FlagsOverride;
}
template<typename T> class SplitBase
{

0 comments on commit deaa17a

Please sign in to comment.