diff --git a/include/athena/DNAOp.hpp b/include/athena/DNAOp.hpp index b9d1978..271dd63 100644 --- a/include/athena/DNAOp.hpp +++ b/include/athena/DNAOp.hpp @@ -56,7 +56,7 @@ constexpr PropId operator"" _propid(const char* s, size_t len) { return {s}; } enum class PropType { None, CRC32, CRC64 }; template -using __IsPODType = typename std::disjunction< +using __IsPODType = std::disjunction< std::is_arithmetic>, std::is_convertible&, atVec2f&>, std::is_convertible&, atVec3f&>, std::is_convertible&, atVec4f&>, std::is_convertible&, atVec2d&>, std::is_convertible&, atVec3d&>, @@ -65,7 +65,7 @@ template constexpr bool __IsPODType_v = __IsPODType::value; template -using __CastPODType = typename std::conditional_t< +using __CastPODType = std::conditional_t< std::is_convertible_v&, atVec2f&>, atVec2f, std::conditional_t< std::is_convertible_v&, atVec3f&>, atVec3f, @@ -112,7 +112,7 @@ struct BinarySize { using PropT = std::conditional_t; using StreamT = size_t; template - static typename std::enable_if_t> Do(const PropId& id, T& var, StreamT& s) { + static std::enable_if_t> Do(const PropId& id, T& var, StreamT& s) { if (PropOp != PropType::None) { /* Accessed via Enumerate, header */ s += 6; @@ -121,7 +121,7 @@ struct BinarySize { BinarySize::Do(id, *reinterpret_cast(&var), s); } template - static typename std::enable_if_t<__IsPODType_v> Do(const PropId& id, T& var, StreamT& s) { + static std::enable_if_t<__IsPODType_v> Do(const PropId& id, T& var, StreamT& s) { if (PropOp != PropType::None) { /* Accessed via Enumerate, header */ s += 6; @@ -130,19 +130,17 @@ struct BinarySize { BinarySize::Do(id, static_cast(const_cast&>(var)), s); } template - static typename std::enable_if_t<__IsDNARecord_v && PropOp != PropType::None> Do(const PropId& id, T& var, - StreamT& s) { + static std::enable_if_t<__IsDNARecord_v && PropOp != PropType::None> Do(const PropId& id, T& var, StreamT& s) { /* Accessed via Enumerate, header */ s += 6; var.template Enumerate>(s); } template - static typename std::enable_if_t<__IsDNARecord_v && PropOp == PropType::None> Do(const PropId& id, T& var, - StreamT& s) { + static std::enable_if_t<__IsDNARecord_v && PropOp == PropType::None> Do(const PropId& id, T& var, StreamT& s) { var.template Enumerate>(s); } template - static typename std::enable_if_t> Do(const PropId& id, T& var, StreamT& s) { + static std::enable_if_t> Do(const PropId& id, T& var, StreamT& s) { for (auto& v : var) BinarySize::Do, DNAE>(id, v, s); } @@ -151,14 +149,14 @@ struct BinarySize { BinarySize::Do(id, var, s); } template - static typename std::enable_if_t> Do(const PropId& id, std::vector& vector, - const S& count, StreamT& s) { + static std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, + StreamT& s) { for (T& v : vector) BinarySize::Do(id, v, s); } template - static typename std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, - StreamT& s) { + static std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, + StreamT& s) { /* libc++ specializes vector as a bitstream */ s += vector.size(); } @@ -167,7 +165,7 @@ struct BinarySize { s += count; } template - static typename std::enable_if_t> Do(const PropId& id, T& str, StreamT& s) { + static std::enable_if_t> Do(const PropId& id, T& str, StreamT& s) { s += str.size() + 1; } static void Do(const PropId& id, std::string& str, atInt32 count, StreamT& s) { @@ -177,7 +175,7 @@ struct BinarySize { s += count; } template - static typename std::enable_if_t> Do(const PropId& id, T& str, StreamT& s) { + static std::enable_if_t> Do(const PropId& id, T& str, StreamT& s) { s += str.size() * 2 + 2; } template @@ -263,7 +261,7 @@ struct PropCount { s += 1; } template - static typename std::enable_if_t> Do(const PropId& id, T& str, StreamT& s) { + static std::enable_if_t> Do(const PropId& id, T& str, StreamT& s) { /* Only reports one level of properties */ s += 1; } @@ -272,7 +270,7 @@ struct PropCount { s += 1; } template - static typename std::enable_if_t> Do(const PropId& id, T& str, StreamT& s) { + static std::enable_if_t> Do(const PropId& id, T& str, StreamT& s) { /* Only reports one level of properties */ s += 1; } @@ -290,23 +288,21 @@ struct Read { using PropT = std::conditional_t; using StreamT = IStreamReader; template - static typename std::enable_if_t> Do(const PropId& id, T& var, StreamT& r) { + static std::enable_if_t> Do(const PropId& id, T& var, StreamT& r) { using PODType = std::underlying_type_t; Read::Do(id, *reinterpret_cast(&var), r); } template - static typename std::enable_if_t<__IsPODType_v> Do(const PropId& id, T& var, StreamT& r) { + static std::enable_if_t<__IsPODType_v> Do(const PropId& id, T& var, StreamT& r) { using CastT = __CastPODType; Read::Do(id, static_cast(var), r); } template - static typename std::enable_if_t<__IsDNARecord() && PropOp == PropType::None> Do(const PropId& id, T& var, - StreamT& r) { + static std::enable_if_t<__IsDNARecord() && PropOp == PropType::None> Do(const PropId& id, T& var, StreamT& r) { var.template Enumerate>(r); } template - static typename std::enable_if_t<__IsDNARecord() && PropOp != PropType::None> Do(const PropId& id, T& var, - StreamT& r) { + static std::enable_if_t<__IsDNARecord() && PropOp != PropType::None> Do(const PropId& id, T& var, StreamT& r) { /* Accessed via Lookup, no header */ atUint16 propCount = __Read16(r); for (atUint32 i = 0; i < propCount; ++i) { @@ -324,7 +320,7 @@ struct Read { } } template - static typename std::enable_if_t> Do(const PropId& id, T& var, StreamT& s) { + static std::enable_if_t> Do(const PropId& id, T& var, StreamT& s) { for (auto& v : var) Read::Do, DNAE>(id, v, s); } @@ -333,8 +329,8 @@ struct Read { Read::Do(id, var, s); } template - static typename std::enable_if_t> Do(const PropId& id, std::vector& vector, - const S& count, StreamT& r) { + static std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, + StreamT& r) { vector.clear(); vector.reserve(count); for (size_t i = 0; i < static_cast(count); ++i) { @@ -343,8 +339,8 @@ struct Read { } } template - static typename std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, - StreamT& r) { + static std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, + StreamT& r) { /* libc++ specializes vector as a bitstream */ vector.clear(); vector.reserve(count); @@ -356,12 +352,12 @@ struct Read { r.readUBytesToBuf(buf.get(), count); } template - static typename std::enable_if_t> Do(const PropId& id, T& str, StreamT& r) { + static std::enable_if_t> Do(const PropId& id, T& str, StreamT& r) { str = r.readString(); } static void Do(const PropId& id, std::string& str, atInt32 count, StreamT& r) { str = r.readString(count); } template - static typename std::enable_if_t> Do(const PropId& id, T& str, StreamT& r) { + static std::enable_if_t> Do(const PropId& id, T& str, StreamT& r) { Read::Do(id, str, r); } template @@ -429,7 +425,7 @@ struct Write { using PropT = std::conditional_t; using StreamT = IStreamWriter; template - static typename std::enable_if_t> Do(const PropId& id, T& var, StreamT& w) { + static std::enable_if_t> Do(const PropId& id, T& var, StreamT& w) { if (PropOp != PropType::None) { /* Accessed via Enumerate, header */ if (PropOp == PropType::CRC64) @@ -444,7 +440,7 @@ struct Write { Write::Do(id, *reinterpret_cast(&var), w); } template - static typename std::enable_if_t<__IsPODType_v> Do(const PropId& id, T& var, StreamT& w) { + static std::enable_if_t<__IsPODType_v> Do(const PropId& id, T& var, StreamT& w) { using CastT = __CastPODType; if (PropOp != PropType::None) { /* Accessed via Enumerate, header */ @@ -460,8 +456,7 @@ struct Write { Write::Do(id, static_cast(const_cast&>(var)), w); } template - static typename std::enable_if_t<__IsDNARecord() && PropOp != PropType::None> Do(const PropId& id, T& var, - StreamT& w) { + static std::enable_if_t<__IsDNARecord() && PropOp != PropType::None> Do(const PropId& id, T& var, StreamT& w) { /* Accessed via Enumerate, header */ if (PropOp == PropType::CRC64) __Write64(w, id.crc64); @@ -477,12 +472,11 @@ struct Write { var.template Enumerate>(w); } template - static typename std::enable_if_t<__IsDNARecord() && PropOp == PropType::None> Do(const PropId& id, T& var, - StreamT& w) { + static std::enable_if_t<__IsDNARecord() && PropOp == PropType::None> Do(const PropId& id, T& var, StreamT& w) { var.template Enumerate>(w); } template - static typename std::enable_if_t> Do(const PropId& id, T& var, StreamT& s) { + static std::enable_if_t> Do(const PropId& id, T& var, StreamT& s) { for (auto& v : var) Write::Do, DNAE>(id, v, s); } @@ -491,14 +485,14 @@ struct Write { Write::Do(id, var, s); } template - static typename std::enable_if_t> Do(const PropId& id, std::vector& vector, - const S& count, StreamT& w) { + static std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, + StreamT& w) { for (T& v : vector) Write::Do(id, v, w); } template - static typename std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, - StreamT& w) { + static std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, + StreamT& w) { /* libc++ specializes vector as a bitstream */ for (const T& v : vector) w.writeBool(v); @@ -508,13 +502,12 @@ struct Write { w.writeUBytes(buf.get(), count); } template - static typename std::enable_if_t> Do(const PropId& id, std::string& str, StreamT& w) { + static std::enable_if_t> Do(const PropId& id, std::string& str, StreamT& w) { w.writeString(str); } static void Do(const PropId& id, std::string& str, atInt32 count, StreamT& w) { w.writeString(str, count); } template - static typename std::enable_if_t> Do(const PropId& id, std::wstring& str, - StreamT& w) { + static std::enable_if_t> Do(const PropId& id, std::wstring& str, StreamT& w) { Write::Do(id, str, w); } template @@ -580,22 +573,22 @@ struct ReadYaml { using PropT = std::conditional_t; using StreamT = YAMLDocReader; template - static typename std::enable_if_t> Do(const PropId& id, T& var, StreamT& r) { + static std::enable_if_t> Do(const PropId& id, T& var, StreamT& r) { using PODType = std::underlying_type_t; ReadYaml::Do(id, *reinterpret_cast(&var), r); } template - static typename std::enable_if_t<__IsPODType_v> Do(const PropId& id, T& var, StreamT& r) { + static std::enable_if_t<__IsPODType_v> Do(const PropId& id, T& var, StreamT& r) { using CastT = __CastPODType; ReadYaml::Do(id, static_cast(var), r); } template - static typename std::enable_if_t<__IsDNARecord_v> Do(const PropId& id, T& var, StreamT& r) { + static std::enable_if_t<__IsDNARecord_v> Do(const PropId& id, T& var, StreamT& r) { if (auto rec = r.enterSubRecord(id.name)) var.template Enumerate>(r); } template - static typename std::enable_if_t> Do(const PropId& id, T& var, StreamT& r) { + static std::enable_if_t> Do(const PropId& id, T& var, StreamT& r) { size_t _count; if (auto __v = r.enterSubVector(id.name, _count)) for (size_t i = 0; i < _count && i < std::extent_v; ++i) @@ -606,8 +599,8 @@ struct ReadYaml { /* Squelch size field access */ } template - static typename std::enable_if_t> Do(const PropId& id, std::vector& vector, - const S& count, StreamT& r) { + static std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, + StreamT& r) { size_t _count; vector.clear(); if (auto __v = r.enterSubVector(id.name, _count)) { @@ -621,8 +614,8 @@ struct ReadYaml { const_cast(count) = vector.size(); } template - static typename std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, - StreamT& r) { + static std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, + StreamT& r) { /* libc++ specializes vector as a bitstream */ size_t _count; vector.clear(); @@ -638,12 +631,12 @@ struct ReadYaml { buf = r.readUBytes(id.name); } template - static typename std::enable_if_t> Do(const PropId& id, T& str, StreamT& r) { + static std::enable_if_t> Do(const PropId& id, T& str, StreamT& r) { str = r.readString(id.name); } static void Do(const PropId& id, std::string& str, atInt32 count, StreamT& r) { str = r.readString(id.name); } template - static typename std::enable_if_t> Do(const PropId& id, T& str, StreamT& r) { + static std::enable_if_t> Do(const PropId& id, T& str, StreamT& r) { str = r.readWString(id.name); } template @@ -697,22 +690,22 @@ struct WriteYaml { using PropT = std::conditional_t; using StreamT = YAMLDocWriter; template - static typename std::enable_if_t> Do(const PropId& id, T& var, StreamT& w) { + static std::enable_if_t> Do(const PropId& id, T& var, StreamT& w) { using PODType = std::underlying_type_t; WriteYaml::Do(id, *reinterpret_cast(&var), w); } template - static typename std::enable_if_t<__IsPODType_v> Do(const PropId& id, T& var, StreamT& w) { + static std::enable_if_t<__IsPODType_v> Do(const PropId& id, T& var, StreamT& w) { using CastT = __CastPODType; WriteYaml::Do(id, static_cast(const_cast&>(var)), w); } template - static typename std::enable_if_t<__IsDNARecord_v> Do(const PropId& id, T& var, StreamT& w) { + static std::enable_if_t<__IsDNARecord_v> Do(const PropId& id, T& var, StreamT& w) { if (auto rec = w.enterSubRecord(id.name)) var.template Enumerate>(w); } template - static typename std::enable_if_t> Do(const PropId& id, T& var, StreamT& w) { + static std::enable_if_t> Do(const PropId& id, T& var, StreamT& w) { if (auto __v = w.enterSubVector(id.name)) for (auto& v : var) WriteYaml::Do, DNAE>({}, v, w); @@ -722,15 +715,15 @@ struct WriteYaml { /* Squelch size field access */ } template - static typename std::enable_if_t> Do(const PropId& id, std::vector& vector, - const S& count, StreamT& w) { + static std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, + StreamT& w) { if (auto __v = w.enterSubVector(id.name)) for (T& v : vector) WriteYaml::Do(id, v, w); } template - static typename std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, - StreamT& w) { + static std::enable_if_t> Do(const PropId& id, std::vector& vector, const S& count, + StreamT& w) { /* libc++ specializes vector as a bitstream */ if (auto __v = w.enterSubVector(id.name)) for (const T& v : vector) @@ -740,12 +733,12 @@ struct WriteYaml { w.writeUBytes(id.name, buf, count); } template - static typename std::enable_if_t> Do(const PropId& id, T& str, StreamT& w) { + static std::enable_if_t> Do(const PropId& id, T& str, StreamT& w) { w.writeString(id.name, str); } static void Do(const PropId& id, std::string& str, atInt32 count, StreamT& w) { w.writeString(id.name, str); } template - static typename std::enable_if_t> Do(const PropId& id, T& str, StreamT& w) { + static std::enable_if_t> Do(const PropId& id, T& str, StreamT& w) { w.writeWString(id.name, str); } template diff --git a/include/athena/DNAYaml.hpp b/include/athena/DNAYaml.hpp index 61afad9..0ca0ad4 100644 --- a/include/athena/DNAYaml.hpp +++ b/include/athena/DNAYaml.hpp @@ -9,12 +9,12 @@ namespace athena::io { template -const char* __GetDNAName(const T& dna, typename std::enable_if_t>* = 0) { +const char* __GetDNAName(const T& dna, std::enable_if_t>* = nullptr) { return dna.DNATypeV(); } template -const char* __GetDNAName(const T& dna, typename std::enable_if_t>* = 0) { +const char* __GetDNAName(const T& dna, std::enable_if_t>* = nullptr) { return dna.DNAType(); } diff --git a/include/athena/Global.hpp b/include/athena/Global.hpp index 100731f..f15df4b 100644 --- a/include/athena/Global.hpp +++ b/include/athena/Global.hpp @@ -134,14 +134,13 @@ template struct DNAV; template -using __IsDNARecord = - typename std::disjunction, T>, std::is_base_of, T>>; +using __IsDNARecord = std::disjunction, T>, std::is_base_of, T>>; template constexpr bool __IsDNARecord_v = __IsDNARecord::value; template using __IsDNAVRecord = - typename std::disjunction, T>, std::is_base_of, T>>; + std::disjunction, T>, std::is_base_of, T>>; template constexpr bool __IsDNAVRecord_v = __IsDNAVRecord::value; } // namespace io diff --git a/include/athena/IStreamReader.hpp b/include/athena/IStreamReader.hpp index 752576e..6ee4221 100644 --- a/include/athena/IStreamReader.hpp +++ b/include/athena/IStreamReader.hpp @@ -68,15 +68,15 @@ public: return val; } template - atInt8 readVal(typename std::enable_if::value>::type* = 0) { + atInt8 readVal(std::enable_if_t>* = nullptr) { return readByte(); } template - atInt8 readValLittle(typename std::enable_if::value>::type* = 0) { + atInt8 readValLittle(std::enable_if_t>* = nullptr) { return readByte(); } template - atInt8 readValBig(typename std::enable_if::value>::type* = 0) { + atInt8 readValBig(std::enable_if_t>* = nullptr) { return readByte(); } @@ -86,15 +86,15 @@ public: */ atUint8 readUByte() { return readByte(); } template - atUint8 readVal(typename std::enable_if::value>::type* = 0) { + atUint8 readVal(std::enable_if_t>* = nullptr) { return readUByte(); } template - atUint8 readValLittle(typename std::enable_if::value>::type* = 0) { + atUint8 readValLittle(std::enable_if_t>* = nullptr) { return readUByte(); } template - atUint8 readValBig(typename std::enable_if::value>::type* = 0) { + atUint8 readValBig(std::enable_if_t>* = nullptr) { return readUByte(); } @@ -144,7 +144,7 @@ public: return m_endian == Big ? utility::BigInt16(val) : utility::LittleInt16(val); } template - atInt16 readVal(typename std::enable_if::value>::type* = 0) { + atInt16 readVal(std::enable_if_t>* = nullptr) { return readInt16(); } @@ -159,7 +159,7 @@ public: return utility::LittleInt16(val); } template - atInt16 readValLittle(typename std::enable_if::value>::type* = 0) { + atInt16 readValLittle(std::enable_if_t>* = nullptr) { return readInt16Little(); } @@ -174,7 +174,7 @@ public: return utility::BigInt16(val); } template - atInt16 readValBig(typename std::enable_if::value>::type* = 0) { + atInt16 readValBig(std::enable_if_t>* = nullptr) { return readInt16Big(); } @@ -185,7 +185,7 @@ public: */ atUint16 readUint16() { return readInt16(); } template - atUint16 readVal(typename std::enable_if::value>::type* = 0) { + atUint16 readVal(std::enable_if_t>* = 0) { return readUint16(); } @@ -200,7 +200,7 @@ public: return utility::LittleUint16(val); } template - atUint16 readValLittle(typename std::enable_if::value>::type* = 0) { + atUint16 readValLittle(std::enable_if_t>* = nullptr) { return readUint16Little(); } @@ -215,7 +215,7 @@ public: return utility::BigUint16(val); } template - atUint16 readValBig(typename std::enable_if::value>::type* = 0) { + atUint16 readValBig(std::enable_if_t>* = nullptr) { return readUint16Big(); } @@ -230,7 +230,7 @@ public: return m_endian == Big ? utility::BigInt32(val) : utility::LittleInt32(val); } template - atInt32 readVal(typename std::enable_if::value>::type* = 0) { + atInt32 readVal(std::enable_if_t>* = nullptr) { return readInt32(); } @@ -245,7 +245,7 @@ public: return utility::LittleInt32(val); } template - atInt32 readValLittle(typename std::enable_if::value>::type* = 0) { + atInt32 readValLittle(std::enable_if_t>* = nullptr) { return readInt32Little(); } @@ -260,7 +260,7 @@ public: return utility::BigInt32(val); } template - atInt32 readValBig(typename std::enable_if::value>::type* = 0) { + atInt32 readValBig(std::enable_if_t>* = nullptr) { return readInt32Big(); } @@ -271,7 +271,7 @@ public: */ atUint32 readUint32() { return readInt32(); } template - atUint32 readVal(typename std::enable_if::value>::type* = 0) { + atUint32 readVal(std::enable_if_t>* = nullptr) { return readUint32(); } @@ -286,7 +286,7 @@ public: return utility::LittleUint32(val); } template - atInt32 readValLittle(typename std::enable_if::value>::type* = 0) { + atInt32 readValLittle(std::enable_if_t>* = nullptr) { return readUint32Little(); } @@ -301,7 +301,7 @@ public: return utility::BigUint32(val); } template - atUint32 readValBig(typename std::enable_if::value>::type* = 0) { + atUint32 readValBig(std::enable_if_t>* = nullptr) { return readUint32Big(); } @@ -316,7 +316,7 @@ public: return m_endian == Big ? utility::BigInt64(val) : utility::LittleInt64(val); } template - atInt64 readVal(typename std::enable_if::value>::type* = 0) { + atInt64 readVal(std::enable_if_t>* = nullptr) { return readInt64(); } @@ -331,7 +331,7 @@ public: return utility::LittleInt64(val); } template - atInt64 readValLittle(typename std::enable_if::value>::type* = 0) { + atInt64 readValLittle(std::enable_if_t>* = nullptr) { return readInt64Little(); } @@ -346,7 +346,7 @@ public: return utility::BigInt64(val); } template - atInt64 readValBig(typename std::enable_if::value>::type* = 0) { + atInt64 readValBig(std::enable_if_t>* = nullptr) { return readInt64Big(); } @@ -357,7 +357,7 @@ public: */ atUint64 readUint64() { return readInt64(); } template - atUint64 readVal(typename std::enable_if::value>::type* = 0) { + atUint64 readVal(std::enable_if_t>* = nullptr) { return readUint64(); } @@ -372,7 +372,7 @@ public: return utility::LittleUint64(val); } template - atUint64 readValLittle(typename std::enable_if::value>::type* = 0) { + atUint64 readValLittle(std::enable_if_t>* = nullptr) { return readUint64Little(); } @@ -387,7 +387,7 @@ public: return utility::BigUint64(val); } template - atUint64 readValBig(typename std::enable_if::value>::type* = 0) { + atUint64 readValBig(std::enable_if_t>* = nullptr) { return readUint64Big(); } @@ -402,7 +402,7 @@ public: return m_endian == Big ? utility::BigFloat(val) : utility::LittleFloat(val); } template - float readVal(typename std::enable_if::value>::type* = 0) { + float readVal(std::enable_if_t>* = nullptr) { return readFloat(); } @@ -417,7 +417,7 @@ public: return utility::LittleFloat(val); } template - float readValLittle(typename std::enable_if::value>::type* = 0) { + float readValLittle(std::enable_if_t>* = nullptr) { return readFloatLittle(); } @@ -432,7 +432,7 @@ public: return utility::BigFloat(val); } template - float readValBig(typename std::enable_if::value>::type* = 0) { + float readValBig(std::enable_if_t>* = nullptr) { return readFloatBig(); } @@ -447,7 +447,7 @@ public: return m_endian == Big ? utility::BigDouble(val) : utility::LittleDouble(val); } template - double readVal(typename std::enable_if::value>::type* = 0) { + double readVal(std::enable_if_t>* = nullptr) { return readDouble(); } @@ -462,7 +462,7 @@ public: return utility::LittleDouble(val); } template - double readValLittle(typename std::enable_if::value>::type* = 0) { + double readValLittle(std::enable_if_t>* = nullptr) { return readDoubleLittle(); } @@ -477,7 +477,7 @@ public: return utility::BigDouble(val); } template - double readValBig(typename std::enable_if::value>::type* = 0) { + double readValBig(std::enable_if_t>* = nullptr) { return readDoubleBig(); } @@ -491,15 +491,15 @@ public: return val != 0; } template - bool readVal(typename std::enable_if::value>::type* = 0) { + bool readVal(std::enable_if_t>* = nullptr) { return readBool(); } template - bool readValLittle(typename std::enable_if::value>::type* = 0) { + bool readValLittle(std::enable_if_t>* = nullptr) { return readBool(); } template - bool readValBig(typename std::enable_if::value>::type* = 0) { + bool readValBig(std::enable_if_t>* = nullptr) { return readBool(); } @@ -525,7 +525,7 @@ public: return s; } template - atVec2f readVal(typename std::enable_if::value>::type* = 0) { + atVec2f readVal(std::enable_if_t>* = nullptr) { return readVec2f(); } @@ -546,7 +546,7 @@ public: return s; } template - atVec2f readValLittle(typename std::enable_if::value>::type* = 0) { + atVec2f readValLittle(std::enable_if_t>* = nullptr) { return readVec2fLittle(); } @@ -567,7 +567,7 @@ public: return s; } template - atVec2f readValBig(typename std::enable_if::value>::type* = 0) { + atVec2f readValBig(std::enable_if_t>* = nullptr) { return readVec2fBig(); } @@ -594,7 +594,7 @@ public: return s; } template - atVec3f readVal(typename std::enable_if::value>::type* = 0) { + atVec3f readVal(std::enable_if_t>* = nullptr) { return readVec3f(); } @@ -615,7 +615,7 @@ public: return s; } template - atVec3f readValLittle(typename std::enable_if::value>::type* = 0) { + atVec3f readValLittle(std::enable_if_t>* = nullptr) { return readVec3fLittle(); } @@ -636,7 +636,7 @@ public: return s; } template - atVec3f readValBig(typename std::enable_if::value>::type* = 0) { + atVec3f readValBig(std::enable_if_t>* = nullptr) { return readVec3fBig(); } @@ -664,7 +664,7 @@ public: return s; } template - atVec4f readVal(typename std::enable_if::value>::type* = 0) { + atVec4f readVal(std::enable_if_t>* = nullptr) { return readVec4f(); } @@ -685,7 +685,7 @@ public: return s; } template - atVec4f readValLittle(typename std::enable_if::value>::type* = 0) { + atVec4f readValLittle(std::enable_if_t>* = nullptr) { return readVec4fLittle(); } @@ -706,7 +706,7 @@ public: return s; } template - atVec4f readValBig(typename std::enable_if::value>::type* = 0) { + atVec4f readValBig(std::enable_if_t>* = nullptr) { return readVec4fBig(); } @@ -732,7 +732,7 @@ public: return s; } template - atVec2d readVal(typename std::enable_if::value>::type* = 0) { + atVec2d readVal(std::enable_if_t>* = nullptr) { return readVec2d(); } @@ -753,7 +753,7 @@ public: return s; } template - atVec2d readValLittle(typename std::enable_if::value>::type* = 0) { + atVec2d readValLittle(std::enable_if_t>* = nullptr) { return readVec2dLittle(); } @@ -774,7 +774,7 @@ public: return s; } template - atVec2d readValBig(typename std::enable_if::value>::type* = 0) { + atVec2d readValBig(std::enable_if_t>* = nullptr) { return readVec2dBig(); } @@ -801,7 +801,7 @@ public: return s; } template - atVec3d readVal(typename std::enable_if::value>::type* = 0) { + atVec3d readVal(std::enable_if_t>* = nullptr) { return readVec3d(); } @@ -822,7 +822,7 @@ public: return s; } template - atVec3d readValLittle(typename std::enable_if::value>::type* = 0) { + atVec3d readValLittle(std::enable_if_t>* = nullptr) { return readVec3dLittle(); } @@ -843,7 +843,7 @@ public: return s; } template - atVec3d readValBig(typename std::enable_if::value>::type* = 0) { + atVec3d readValBig(std::enable_if_t>* = nullptr) { return readVec3dBig(); } @@ -871,7 +871,7 @@ public: return s; } template - atVec4d readVal(typename std::enable_if::value>::type* = 0) { + atVec4d readVal(std::enable_if_t>* = nullptr) { return readVec4d(); } @@ -892,7 +892,7 @@ public: return s; } template - atVec4d readValLittle(typename std::enable_if::value>::type* = 0) { + atVec4d readValLittle(std::enable_if_t>* = nullptr) { return readVec4dLittle(); } @@ -913,7 +913,7 @@ public: return s; } template - atVec4d readValBig(typename std::enable_if::value>::type* = 0) { + atVec4d readValBig(std::enable_if_t>* = nullptr) { return readVec4dBig(); } @@ -944,7 +944,7 @@ public: return ret; } template - std::string readVal(typename std::enable_if::value>::type* = 0) { + std::string readVal(std::enable_if_t>* = nullptr) { return readString(); } @@ -976,7 +976,7 @@ public: return ret; } template - std::wstring readVal(typename std::enable_if::value>::type* = 0) { + std::wstring readVal(std::enable_if_t>* = nullptr) { return readWString(); } @@ -1009,7 +1009,7 @@ public: return ret; } template - std::wstring readValLittle(typename std::enable_if::value>::type* = 0) { + std::wstring readValLittle(std::enable_if_t>* = nullptr) { return readWStringLittle(); } @@ -1041,7 +1041,7 @@ public: return ret; } template - std::wstring readValBig(typename std::enable_if::value>::type* = 0) { + std::wstring readValBig(std::enable_if_t>* = nullptr) { return readWStringBig(); } @@ -1073,7 +1073,7 @@ public: return ret; } template - std::u16string readValBig(typename std::enable_if::value>::type* = 0) { + std::u16string readValBig(std::enable_if_t>* = nullptr) { return readU16StringBig(); } @@ -1105,7 +1105,7 @@ public: return ret; } template - std::u32string readValBig(typename std::enable_if::value>::type* = 0) { + std::u32string readValBig(std::enable_if_t>* = nullptr) { return readU32StringBig(); } @@ -1117,10 +1117,9 @@ public: * Endianness is set with setEndian */ template - void - enumerate(std::vector& vector, size_t count, - typename std::enable_if::value || std::is_same::value || - std::is_same::value || std::is_same::value>::type* = 0) { + void enumerate(std::vector& vector, size_t count, + std::enable_if_t || std::is_same_v || std::is_same_v || + std::is_same_v>* = nullptr) { vector.clear(); vector.reserve(count); for (size_t i = 0; i < count; ++i) @@ -1135,10 +1134,9 @@ public: * Endianness is little */ template - void enumerateLittle( - std::vector& vector, size_t count, - typename std::enable_if::value || std::is_same::value || - std::is_same::value || std::is_same::value>::type* = 0) { + void enumerateLittle(std::vector& vector, size_t count, + std::enable_if_t || std::is_same_v || + std::is_same_v || std::is_same_v>* = nullptr) { vector.clear(); vector.reserve(count); for (size_t i = 0; i < count; ++i) @@ -1153,10 +1151,9 @@ public: * Endianness is big */ template - void - enumerateBig(std::vector& vector, size_t count, - typename std::enable_if::value || std::is_same::value || - std::is_same::value || std::is_same::value>::type* = 0) { + void enumerateBig(std::vector& vector, size_t count, + std::enable_if_t || std::is_same_v || + std::is_same_v || std::is_same_v>* = nullptr) { vector.clear(); vector.reserve(count); for (size_t i = 0; i < count; ++i) @@ -1169,10 +1166,9 @@ public: * @param count The number of elements to read into vector */ template - void - enumerate(std::vector& vector, size_t count, - typename std::enable_if::value && !std::is_same::value && - !std::is_same::value && !std::is_same::value>::type* = 0) { + void enumerate(std::vector& vector, size_t count, + std::enable_if_t && !std::is_same_v && + !std::is_same_v && !std::is_same_v>* = nullptr) { vector.clear(); vector.reserve(count); for (size_t i = 0; i < count; ++i) { diff --git a/include/athena/IStreamWriter.hpp b/include/athena/IStreamWriter.hpp index edfd34e..0f397cb 100644 --- a/include/athena/IStreamWriter.hpp +++ b/include/athena/IStreamWriter.hpp @@ -989,10 +989,9 @@ public: * Endianness is set with setEndian */ template - void - enumerate(const std::vector& vector, - typename std::enable_if::value || std::is_same::value || - std::is_same::value || std::is_same::value>::type* = 0) { + void enumerate(const std::vector& vector, + std::enable_if_t || std::is_same_v || std::is_same_v || + std::is_same_v>* = nullptr) { for (const T& item : vector) writeVal(item); } @@ -1003,10 +1002,9 @@ public: * Endianness is little */ template - void enumerateLittle( - const std::vector& vector, - typename std::enable_if::value || std::is_same::value || - std::is_same::value || std::is_same::value>::type* = 0) { + void enumerateLittle(const std::vector& vector, + std::enable_if_t || std::is_same_v || + std::is_same_v || std::is_same_v>* = nullptr) { for (const T& item : vector) writeValLittle(item); } @@ -1017,10 +1015,9 @@ public: * Endianness is big */ template - void - enumerateBig(const std::vector& vector, - typename std::enable_if::value || std::is_same::value || - std::is_same::value || std::is_same::value>::type* = 0) { + void enumerateBig(const std::vector& vector, + std::enable_if_t || std::is_same_v || + std::is_same_v || std::is_same_v>* = nullptr) { for (const T& item : vector) writeValBig(item); } @@ -1029,10 +1026,9 @@ public: * @param vector The std::vector read from when writing data */ template - void - enumerate(const std::vector& vector, - typename std::enable_if::value && !std::is_same::value && - !std::is_same::value && !std::is_same::value>::type* = 0) { + void enumerate(const std::vector& vector, + std::enable_if_t && !std::is_same_v && + !std::is_same_v && !std::is_same_v>* = nullptr) { for (const T& item : vector) item.write(*this); } diff --git a/include/athena/YAMLDocReader.hpp b/include/athena/YAMLDocReader.hpp index 06a1ab3..45f160c 100644 --- a/include/athena/YAMLDocReader.hpp +++ b/include/athena/YAMLDocReader.hpp @@ -54,7 +54,7 @@ public: RecordRAII enterSubRecord(const char* name); template - void enumerate(const char* name, T& record, typename std::enable_if_t<__IsDNARecord_v>* = 0) { + void enumerate(const char* name, T& record, std::enable_if_t<__IsDNARecord_v>* = nullptr) { if (auto rec = enterSubRecord(name)) record.read(*this); } @@ -77,10 +77,9 @@ public: VectorRAII enterSubVector(const char* name, size_t& countOut); template - size_t - enumerate(const char* name, std::vector& vector, - typename std::enable_if_t::value && !std::is_same::value && - !std::is_same::value && !std::is_same::value>* = 0) { + size_t enumerate(const char* name, std::vector& vector, + std::enable_if_t && !std::is_same_v && + !std::is_same_v && !std::is_same_v>* = nullptr) { size_t countOut; if (auto v = enterSubVector(name, countOut)) { vector.clear(); @@ -96,8 +95,8 @@ public: template size_t enumerate(const char* name, std::vector& vector, - typename std::enable_if_t::value || std::is_same::value || - std::is_same::value || std::is_same::value>* = 0) { + std::enable_if_t || std::is_same_v || + std::is_same_v || std::is_same_v>* = nullptr) { size_t countOut; if (auto v = enterSubVector(name, countOut)) { vector.clear(); diff --git a/include/athena/YAMLDocWriter.hpp b/include/athena/YAMLDocWriter.hpp index b1f1d36..c590674 100644 --- a/include/athena/YAMLDocWriter.hpp +++ b/include/athena/YAMLDocWriter.hpp @@ -40,7 +40,7 @@ public: RecordRAII enterSubRecord(const char* name); template - void enumerate(const char* name, T& record, typename std::enable_if_t<__IsDNARecord_v>* = 0) { + void enumerate(const char* name, T& record, std::enable_if_t<__IsDNARecord_v>* = nullptr) { if (auto rec = enterSubRecord(name)) record.write(*this); } @@ -63,11 +63,11 @@ public: VectorRAII enterSubVector(const char* name); template - void enumerate(const char* name, const std::vector& vector, - typename std::enable_if_t::value && !std::is_same::value && - !std::is_same::value && !std::is_same::value && - !std::is_same::value && !std::is_same::value && - !std::is_same::value>* = 0) { + void + enumerate(const char* name, const std::vector& vector, + std::enable_if_t && !std::is_same_v && !std::is_same_v && + !std::is_same_v && !std::is_same_v && + !std::is_same_v && !std::is_same_v>* = nullptr) { if (auto v = enterSubVector(name)) for (const T& item : vector) if (auto rec = enterSubRecord(nullptr)) @@ -76,10 +76,9 @@ public: template void enumerate(const char* name, const std::vector& vector, - typename std::enable_if_t::value || std::is_same::value || - std::is_same::value || std::is_same::value || - std::is_same::value || std::is_same::value || - std::is_same::value>* = 0) { + std::enable_if_t || std::is_same_v || std::is_same_v || + std::is_same_v || std::is_same_v || + std::is_same_v || std::is_same_v>* = nullptr) { if (auto v = enterSubVector(name)) for (T item : vector) writeVal(nullptr, item);