From 32928cddf43002c8f97bd9293660b2a2e877846b Mon Sep 17 00:00:00 2001 From: Joseph Edwards Date: Wed, 13 Nov 2024 12:05:46 +0000 Subject: [PATCH] Add static assertion for size of N --- include/libsemigroups/schreier-sims.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/libsemigroups/schreier-sims.hpp b/include/libsemigroups/schreier-sims.hpp index 26ebf861c..540c5496e 100644 --- a/include/libsemigroups/schreier-sims.hpp +++ b/include/libsemigroups/schreier-sims.hpp @@ -43,6 +43,7 @@ #include // for size_t #include // for uint64_t #include // for distance +#include // for numeric_limits #include // for make_unique #include // for operator+, basic_string #include // for string_view @@ -58,6 +59,7 @@ #include "detail/bruidhinn-traits.hpp" // for BruidhinnTraits #include "detail/containers.hpp" // for Array2, StaticTriVector2 +#include "detail/fmt.hpp" // for format #include "detail/int-range.hpp" // for IntRange namespace libsemigroups { @@ -179,6 +181,9 @@ namespace libsemigroups { std::is_same::value, "incompatible element types, Traits::element_type and Element " "must be the same"); + static_assert(N <= std::numeric_limits::max(), + "the first template parameter N cannot be expressed as value " + "of type equal to the second template parameter Point"); using internal_element_type = typename detail::BruidhinnTraits::internal_value_type;