Work around some holes in the BitmaskType specification

This commit is contained in:
mniip 2018-05-08 06:05:12 +03:00
parent d404f4a538
commit deaa17a947
2 changed files with 12 additions and 8 deletions

View File

@ -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); }

View File

@ -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
{