更新时间:2023-10-06 08:20:46
template<typename T, typename U, typename Tout>
requires std::is_integral_v<typename T::value_type>
&& std::is_floating_point_v<typename U::value_type>
&& std::is_floating_point_v<typename Tout::value_type>
class test {
public:
test()=default;
};
int main() {
test<int, int, int> t;
}
main.cpp: In function 'int main()':
main.cpp:16:21: error: template constraint failure for 'template<class T, class U, class Tout> requires (is_integral_v<typename T::value_type>) && (is_floating_point_v<typename U::value_type>) && (is_floating_point_v<typename Tout::value_type>) class test'
16 | test<int, int, int> t;
| ^
main.cpp:16:21: note: constraints not satisfied