【发布时间】:2021-09-11 23:01:46
【问题描述】:
我正在尝试使用概念对某些模板方法进行显式特化,但它没有在gcc 或msvc 上编译,但可以在clang 上编译...谁是对的?
#include <type_traits>
template<typename T>
concept arithmetic = std::is_arithmetic_v<T> && !std::is_same_v<T, bool>;
template<typename T>
void foo(const T &value, int &result);
template<>
void foo(const arithmetic auto &value, int &result) {
}
【问题讨论】:
-
最新版3个都可以做概念见en.cppreference.com/w/cpp/compiler_support/20
-
但我尝试了所有 3 个的最新版本,请检查链接
标签: c++ c++20 c++-concepts