문제

Is there any way to determine that some type is non-copyable during compile time? I need following:

template<typename T, unsigned long long MaxSize>
struct circular_buffer : boost::noncopyable {
    static_assert(typeof(T) ?????, "T must be noncopyable!");
};
도움이 되었습니까?

해결책

C++11 has the is_copy_assignable and is_copy_constructible type traits. Assert that both are false.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top