有什么方法可以static_assert,模板参数是不可复制的

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

本文关键字:参数 可复制 assert 方法 什么 static      更新时间:2023-10-16

是否有任何方法可以确定某种类型在编译时间内不可仿制?我需要以下内容:

template<typename T, unsigned long long MaxSize>
struct circular_buffer : boost::noncopyable {
    static_assert(typeof(T) ?????, "T must be noncopyable!");
};

c 11具有is_copy_assignableis_copy_constructible类型特征。断言两个都是错误的。