Fixed compilation with MSVC/C++20+.
This commit is contained in:
parent
c014fe47fb
commit
f77823ca2f
@ -9,6 +9,7 @@
|
||||
#include <source_location>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
#include <mijin/util/bitflags.hpp>
|
||||
@ -175,11 +176,11 @@ struct BitFlagsType
|
||||
unsigned maxBits = 0;
|
||||
};
|
||||
|
||||
using type_t = std::variant<VoidType, BoolType, IntType, FloatType, CharType, ArrayType, ClassType, StructType, PointerType, ReferenceType, ConstType, VolatileType, STDType, BitFlagsType>;
|
||||
struct Type : type_t
|
||||
using type_base_t = std::variant<VoidType, BoolType, IntType, FloatType, CharType, ArrayType, ClassType, StructType, PointerType, ReferenceType, ConstType, VolatileType, STDType, BitFlagsType>;
|
||||
struct Type : type_base_t
|
||||
{
|
||||
template<typename... TArgs>
|
||||
constexpr Type(TArgs&&... args) noexcept : type_t(std::forward<TArgs>(args)...) {}
|
||||
constexpr Type(TArgs&&... args) noexcept : type_base_t(std::forward<TArgs>(args)...) {}
|
||||
constexpr Type(const Type&) noexcept = default;
|
||||
constexpr Type(Type&&) noexcept = default;
|
||||
|
||||
@ -477,7 +478,7 @@ const Struct& reflectStruct() noexcept
|
||||
template<typename TVisitor>
|
||||
constexpr decltype(auto) visitIntValue(TVisitor&& visitor, const void* value, const IntType& type)
|
||||
{
|
||||
using return_t = std::result_of_t<TVisitor(const int&)>;
|
||||
using return_t = std::invoke_result_t<TVisitor, const int&>;
|
||||
|
||||
if constexpr (std::is_same_v<return_t, void>)
|
||||
{
|
||||
@ -546,7 +547,7 @@ constexpr decltype(auto) visitIntValue(TVisitor&& visitor, const void* value, co
|
||||
template<typename TVisitor>
|
||||
constexpr decltype(auto) visitFloatValue(TVisitor&& visitor, const void* value, const FloatType& type)
|
||||
{
|
||||
using return_t = std::result_of_t<TVisitor(const float&)>;
|
||||
using return_t = std::invoke_result_t<TVisitor, const float&>;
|
||||
|
||||
if constexpr (std::is_same_v<return_t, void>)
|
||||
{
|
||||
@ -573,7 +574,7 @@ constexpr decltype(auto) visitFloatValue(TVisitor&& visitor, const void* value,
|
||||
template<typename TVisitor>
|
||||
constexpr decltype(auto) visitCharValue(TVisitor&& visitor, const void* value, CharType type)
|
||||
{
|
||||
using return_t = std::result_of_t<TVisitor(const char8_t&)>;
|
||||
using return_t = std::invoke_result_t<TVisitor, const char8_t&>;
|
||||
|
||||
if constexpr (std::is_same_v<return_t, void>)
|
||||
{
|
||||
@ -608,7 +609,7 @@ constexpr decltype(auto) visitCharValue(TVisitor&& visitor, const void* value, C
|
||||
template<typename TVisitor>
|
||||
constexpr decltype(auto) visitIntValue(TVisitor&& visitor, void* value, const IntType& type)
|
||||
{
|
||||
using return_t = std::result_of_t<TVisitor(int&)>;
|
||||
using return_t = std::invoke_result_t<TVisitor, int&>;
|
||||
|
||||
if constexpr (std::is_same_v<return_t, void>)
|
||||
{
|
||||
@ -677,7 +678,7 @@ constexpr decltype(auto) visitIntValue(TVisitor&& visitor, void* value, const In
|
||||
template<typename TVisitor>
|
||||
constexpr decltype(auto) visitFloatValue(TVisitor&& visitor, void* value, const FloatType& type)
|
||||
{
|
||||
using return_t = std::result_of_t<TVisitor(float&)>;
|
||||
using return_t = std::invoke_result_t<TVisitor, float&>;
|
||||
|
||||
if constexpr (std::is_same_v<return_t, void>)
|
||||
{
|
||||
@ -704,7 +705,7 @@ constexpr decltype(auto) visitFloatValue(TVisitor&& visitor, void* value, const
|
||||
template<typename TVisitor>
|
||||
constexpr decltype(auto) visitCharValue(TVisitor&& visitor, void* value, CharType type)
|
||||
{
|
||||
using return_t = std::result_of_t<TVisitor(char8_t&)>;
|
||||
using return_t = std::invoke_result_t<TVisitor, char8_t&>;
|
||||
|
||||
if constexpr (std::is_same_v<return_t, void>)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user