error C2253: pure specifier or abstract override specifier only allowed on virtual

1、用Visual Studio 2012编译下面代码时出现的错误:

#define RTC_DISALLOW_COPY_AND_ASSIGN(TypeName) 
  TypeName(const TypeName&) = delete;          
  RTC_DISALLOW_ASSIGN(TypeName)

错误信息如下:

error C2253: 'scoped_ptr_impl<T,D>' : pure specifier or abstract override specifier only allowed on virtual function

2、原因:c++新特色:使用或禁用对象的默认函数

vs2012不支持= delete,vs2013是支持的

3、解决方案:去掉= delete或者使用更高版本的Visual Studio 

参考:http://blog.csdn.net/dragoo1/article/details/45559869

原文地址:https://www.cnblogs.com/happykoukou/p/5718174.html