diff --git a/src/catch2/generators/catch_generators_random.hpp b/src/catch2/generators/catch_generators_random.hpp index 15043211..8b2c4949 100644 --- a/src/catch2/generators/catch_generators_random.hpp +++ b/src/catch2/generators/catch_generators_random.hpp @@ -65,12 +65,17 @@ public: } }; -// TODO: Ideally this would be also constrained against the various char types, -// but I don't expect users to run into that in practice. template -std::enable_if_t::value && !std::is_same::value, -GeneratorWrapper> +std::enable_if_t::value, GeneratorWrapper> random(T a, T b) { + static_assert( + !std::is_same::value && + !std::is_same::value && + !std::is_same::value && + !std::is_same::value && + !std::is_same::value && + !std::is_same::value, + "The requested type is not supported by the underlying random distributions from std" ); return GeneratorWrapper( Catch::Detail::make_unique>(a, b, Detail::getSeed()) );