(35): error C2752: 'Power_t': more than one partial specialization matches the template argument list
(18): note: could be 'Power_t'
(30): note: or 'Power_t'
(35): note: the template instantiation context (the oldest one first) is
(37): note: see reference to variable template 'const auto Power_v' being compiled
Это ошибка в MSVC, когда возникает следующая ошибка? [code](35): error C2752: 'Power_t': more than one partial specialization matches the template argument list (18): note: could be 'Power_t' (30): note: or 'Power_t' (35): note: the template instantiation context (the oldest one first) is (37): note: see reference to variable template 'const auto Power_v' being compiled [/code] в следующем коде: [code]#include #include // size_t
template concept Multipliable = requires (T a, const T b) { { a *= b } -> std::same_as; { a * b } -> std::same_as; };
/// Primary class template declaration (and definition) for odd powers (inductive step) template struct Power_t { static constexpr auto value = Power_t::value * base; };
/// Partial specialization for even powers (inductive step) template struct Power_t { static constexpr auto value = Power_t::value; };
/// Partial specialization (base case) template struct Power_t { static constexpr auto value = base; };
/// Partial specialization (base case) template struct Power_t { static constexpr auto value = decltype(base){1}; };
int main() { return Power_v; } [/code] GCC-11 и Clang-11 в порядке, вот ошибка в Compler Explorer: https://godbolt.org/z/MxobE8Yve Интересно, что все компиляторы завершаются успешно, когда концептуальные ограничения удалены: https://godbolt.org/z/MzYG9n5bP