boost::noncopyable

/**
 * boost::noncopyable 实现单例不用麻烦了,直接从这个继承就行了
 */
#include <boost/noncopyable.hpp>
class myclass : public boost::noncopyable
{
public:  
    myclass(){};  
    myclass(int i){};  
    myclass(const myclass& m)
    {

    }
};

int main()
{
    myclass cl1();  
    myclass cl2();  

    myclass cl3(cl1);    // 对于这个报错不知为什么后续再看
    myclass cl4(cl2);    
    return 0;
}

 

posted @ 2014-12-01 16:35  zzyoucan  阅读(245)  评论(0编辑  收藏  举报