How do I make this C++ object non-copyable?

前端 未结 10 974
太阳男子
太阳男子 2020-11-28 04:36

See title.

I have:

class Foo {
   private:
     Foo();
   public:
     static Foo* create();
}

What need I do from here to make Fo

10条回答
  •  鱼传尺愫
    2020-11-28 05:13

    #include 
    class Foo : boost::noncopyable {...
    

    But as Scott Meyers once said..."It's a fine class, it's just that I find the name a bit un, err non natural", or something like that.

提交回复
热议问题