1

以下代码:

template<class S, class = void>
constexpr bool is_size = false;
template<class S>
constexpr bool is_size<S, std::void_t<decltype(S::cx, S::cy)>> = true;
template<class S>
constexpr bool is_size<S, std::void_t<decltype(S::width, S::height)>> = true;

error : redefinition of 'is_size<S, std::void_t<decltype(S::width , S::height)>>'.

是否有可能以某种方式实现这个想法,或者唯一可以做的就是与所有尺寸类型进行比较?

4

0 回答 0