[bind10-dev] noncopyable classes

Likun Zhang zlkzhy at gmail.com
Tue Feb 15 02:14:17 UTC 2011


> we have certain classes that we want to be noncopyable, and so far I've seen two
> different ways to do this;
> 
> 1. make it a subclass of boost::noncopyable
> 2. make the copy constructor and the assignment operators private
> 
> The first is slightly shorter, but the second is not that much more work, and it
> has the slight advantage that it at least gets rid of one dependency on boost in
> our headers.
> 
> And of course for the sake of consistency it's better to only use one method
> here, so I'd like to propose we update the coding guidelines to use method 2 for
> this.

I don't want to make this topic complicated, but the following thought always buzzing in my head.
That's: Write our own isc::noncopyable, and then derive from it.

Anyway, it's a solution.  :)

Thanks

Likun











More information about the bind10-dev mailing list