diff --git a/src/openrct2/core/Meta.hpp b/src/openrct2/core/Meta.hpp new file mode 100644 index 0000000000..2293e8ae88 --- /dev/null +++ b/src/openrct2/core/Meta.hpp @@ -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 + +namespace Meta +{ + /** + * Meta function for checking that all Conditions are true types. + */ + template struct all : std::true_type + { + }; + + template + struct all : std::conditional, std::false_type>::type + { + }; + + template using all_convertible = all...>; + +} // namespace Meta diff --git a/src/openrct2/core/Random.hpp b/src/openrct2/core/Random.hpp index 91254c577d..ca0088ca55 100644 --- a/src/openrct2/core/Random.hpp +++ b/src/openrct2/core/Random.hpp @@ -9,6 +9,7 @@ #pragma once +#include "Meta.hpp" #include "Numerics.hpp" #include @@ -41,7 +42,7 @@ namespace Random template< typename... T, typename std::enable_if::type = 0, - typename std::enable_if<(std::is_convertible::value && ...), int>::type = 0> + typename std::enable_if::value, int>::type = 0> explicit FixedSeedSequence(T... s) : v{ static_cast(s)... } {