Is there any way to static_assert that template argument is noncopyable?

c++, c++11, noncopyable, static-assert, type-traits

Solution

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

Problem

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!"); }; ```

Original source