mirror of https://github.com/OpenRCT2/OpenRCT2.git
MSVC SFINAE compatibility
This commit is contained in:
parent
1a81d60609
commit
2ea347f15f
|
@ -0,0 +1,30 @@
|
||||||
|
/*****************************************************************************
|
||||||
|
* Copyright (c) 2014-2019 OpenRCT2 developers
|
||||||
|
*
|
||||||
|
* For a complete list of all authors, please refer to contributors.md
|
||||||
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||||
|
*
|
||||||
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
|
namespace Meta
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Meta function for checking that all Conditions are true types.
|
||||||
|
*/
|
||||||
|
template<typename... Conditions> struct all : std::true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename Condition, typename... Conditions>
|
||||||
|
struct all<Condition, Conditions...> : std::conditional<Condition::value, all<Conditions...>, std::false_type>::type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename Type, typename... Types> using all_convertible = all<std::is_convertible<Types, Type>...>;
|
||||||
|
|
||||||
|
} // namespace Meta
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "Meta.hpp"
|
||||||
#include "Numerics.hpp"
|
#include "Numerics.hpp"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -41,7 +42,7 @@ namespace Random
|
||||||
|
|
||||||
template<
|
template<
|
||||||
typename... T, typename std::enable_if<sizeof...(T) == N, int>::type = 0,
|
typename... T, typename std::enable_if<sizeof...(T) == N, int>::type = 0,
|
||||||
typename std::enable_if<(std::is_convertible<T, result_type>::value && ...), int>::type = 0>
|
typename std::enable_if<Meta::all_convertible<result_type, T...>::value, int>::type = 0>
|
||||||
explicit FixedSeedSequence(T... s)
|
explicit FixedSeedSequence(T... s)
|
||||||
: v{ static_cast<result_type>(s)... }
|
: v{ static_cast<result_type>(s)... }
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue