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 787367b..9468695 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(); } @@ -146,7 +146,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(); } @@ -161,7 +161,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(); } @@ -176,7 +176,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(); } @@ -187,7 +187,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(); } @@ -202,7 +202,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(); } @@ -217,7 +217,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(); } @@ -232,7 +232,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(); } @@ -247,7 +247,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(); } @@ -262,7 +262,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(); } @@ -273,7 +273,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(); } @@ -288,7 +288,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(); } @@ -303,7 +303,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(); } @@ -318,7 +318,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(); } @@ -333,7 +333,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(); } @@ -348,7 +348,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(); } @@ -359,7 +359,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(); } @@ -374,7 +374,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(); } @@ -389,7 +389,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(); } @@ -404,7 +404,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(); } @@ -419,7 +419,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(); } @@ -434,7 +434,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(); } @@ -449,7 +449,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(); } @@ -464,7 +464,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(); } @@ -479,7 +479,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(); } @@ -493,15 +493,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(); } @@ -527,7 +527,7 @@ public: return s; } template - atVec2f readVal(typename std::enable_if::value>::type* = 0) { + atVec2f readVal(std::enable_if_t>* = nullptr) { return readVec2f(); } @@ -548,7 +548,7 @@ public: return s; } template - atVec2f readValLittle(typename std::enable_if::value>::type* = 0) { + atVec2f readValLittle(std::enable_if_t>* = nullptr) { return readVec2fLittle(); } @@ -569,7 +569,7 @@ public: return s; } template - atVec2f readValBig(typename std::enable_if::value>::type* = 0) { + atVec2f readValBig(std::enable_if_t>* = nullptr) { return readVec2fBig(); } @@ -596,7 +596,7 @@ public: return s; } template - atVec3f readVal(typename std::enable_if::value>::type* = 0) { + atVec3f readVal(std::enable_if_t>* = nullptr) { return readVec3f(); } @@ -617,7 +617,7 @@ public: return s; } template - atVec3f readValLittle(typename std::enable_if::value>::type* = 0) { + atVec3f readValLittle(std::enable_if_t>* = nullptr) { return readVec3fLittle(); } @@ -638,7 +638,7 @@ public: return s; } template - atVec3f readValBig(typename std::enable_if::value>::type* = 0) { + atVec3f readValBig(std::enable_if_t>* = nullptr) { return readVec3fBig(); } @@ -666,7 +666,7 @@ public: return s; } template - atVec4f readVal(typename std::enable_if::value>::type* = 0) { + atVec4f readVal(std::enable_if_t>* = nullptr) { return readVec4f(); } @@ -687,7 +687,7 @@ public: return s; } template - atVec4f readValLittle(typename std::enable_if::value>::type* = 0) { + atVec4f readValLittle(std::enable_if_t>* = nullptr) { return readVec4fLittle(); } @@ -708,7 +708,7 @@ public: return s; } template - atVec4f readValBig(typename std::enable_if::value>::type* = 0) { + atVec4f readValBig(std::enable_if_t>* = nullptr) { return readVec4fBig(); } @@ -734,7 +734,7 @@ public: return s; } template - atVec2d readVal(typename std::enable_if::value>::type* = 0) { + atVec2d readVal(std::enable_if_t>* = nullptr) { return readVec2d(); } @@ -755,7 +755,7 @@ public: return s; } template - atVec2d readValLittle(typename std::enable_if::value>::type* = 0) { + atVec2d readValLittle(std::enable_if_t>* = nullptr) { return readVec2dLittle(); } @@ -776,7 +776,7 @@ public: return s; } template - atVec2d readValBig(typename std::enable_if::value>::type* = 0) { + atVec2d readValBig(std::enable_if_t>* = nullptr) { return readVec2dBig(); } @@ -803,7 +803,7 @@ public: return s; } template - atVec3d readVal(typename std::enable_if::value>::type* = 0) { + atVec3d readVal(std::enable_if_t>* = nullptr) { return readVec3d(); } @@ -824,7 +824,7 @@ public: return s; } template - atVec3d readValLittle(typename std::enable_if::value>::type* = 0) { + atVec3d readValLittle(std::enable_if_t>* = nullptr) { return readVec3dLittle(); } @@ -845,7 +845,7 @@ public: return s; } template - atVec3d readValBig(typename std::enable_if::value>::type* = 0) { + atVec3d readValBig(std::enable_if_t>* = nullptr) { return readVec3dBig(); } @@ -873,7 +873,7 @@ public: return s; } template - atVec4d readVal(typename std::enable_if::value>::type* = 0) { + atVec4d readVal(std::enable_if_t>* = nullptr) { return readVec4d(); } @@ -894,7 +894,7 @@ public: return s; } template - atVec4d readValLittle(typename std::enable_if::value>::type* = 0) { + atVec4d readValLittle(std::enable_if_t>* = nullptr) { return readVec4dLittle(); } @@ -915,7 +915,7 @@ public: return s; } template - atVec4d readValBig(typename std::enable_if::value>::type* = 0) { + atVec4d readValBig(std::enable_if_t>* = nullptr) { return readVec4dBig(); } @@ -946,7 +946,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(); } @@ -978,7 +978,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(); } @@ -1011,7 +1011,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(); } @@ -1043,7 +1043,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(); } @@ -1075,7 +1075,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(); } @@ -1107,7 +1107,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(); } @@ -1121,8 +1121,8 @@ public: 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) { + std::enable_if || 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) @@ -1137,10 +1137,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) @@ -1155,10 +1154,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) @@ -1171,10 +1169,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 e10beaf..8dfa166 100644 --- a/include/athena/IStreamWriter.hpp +++ b/include/athena/IStreamWriter.hpp @@ -990,10 +990,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); } @@ -1004,10 +1003,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); } @@ -1018,10 +1016,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); } @@ -1030,10 +1027,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);