no copy constructor available or copy constructor is declared 'explicit'

今天新写了一个类。然后对这个类使用STL中的vector,碰到错误:

no copy constructor available or copy constructor is declared 'explicit'


假设碰到同样错误。能够检查一下重载的拷贝构造函数以及重载的‘=’运算符函数是否有问题,注意输入的參数必须是const类型的,少了constkeyword不行。

posted @ 2016-01-03 17:15  yxwkaifa  阅读(418)  评论(0编辑  收藏  举报