lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] s/obstruct_slicing/final/ ?


From: Vadim Zeitlin
Subject: Re: [lmi] s/obstruct_slicing/final/ ?
Date: Wed, 1 Feb 2017 22:08:30 +0100

On Wed, 1 Feb 2017 19:39:17 +0000 Greg Chicares <address@hidden> wrote:

GC> Vadim--Do you see any reason not to eradicate 'obstruct_slicing*'
GC> and make the classes that derive from it 'final'? I think this is
GC> a good modernization, but I just wanted to hear your thoughts
GC> before I do the work.

 Yes, I think it would be a good idea. I didn't realize immediately that
obstruct_slicing<> actually prevented derivation entirely and not just
slicing, but after rereading the comments in obstruct_slicing.hpp it seems
clear that this is what it does and using "final" is, of course, a much
better of doing it.

 FWIW I'd also like to get rid of uncopyable<>, but I do have to admit that
writing

        foo(foo const&) = delete;
        foo& operator=(foo const&) = delete;

is a bit longer than

        : private uncopyable<foo>

 But I still prefer the former because it's more standard, potentially more
foolproof (I don't see any way of bypassing uncopyable<> but I'm not 100%
convinced there is none) and generalizes easier for the relatively common
cases of not-assignable-but-copyable and, especially, not-copyable-but-
movable classes.

 Regards,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]