YAML streaming for generated types

This commit is contained in:
Pavel Kirienko
2014-03-07 00:43:36 +04:00
parent da6e25a708
commit 4753d4ac79
10 changed files with 386 additions and 5 deletions
@@ -102,6 +102,7 @@ public:
enum { BitLen = BitLen_ };
enum { MinBitLen = BitLen };
enum { MaxBitLen = BitLen };
enum { IsPrimitive = 1 };
typedef typename NativeFloatSelector<BitLen>::Type StorageType;
@@ -157,4 +158,17 @@ private:
}
};
template <unsigned int BitLen, CastMode CastMode>
struct YamlStreamer<FloatSpec<BitLen, CastMode> >
{
typedef typename FloatSpec<BitLen, CastMode>::StorageType StorageType;
template <typename Stream>
static void stream(Stream& s, const StorageType value, int)
{
s << value;
}
};
}