Fwd: Replacing old C-style casts with static|reinterpret_cast?




On 10 May 2017 at 20:51, Chris Vine <vine35792468 gmail com> wrote:

I don't have any recommended reading I am afraid.  The ability to use C
casts to cast from derived to private base is required by these words
in §5.4/4 of C++14, in describing the behaviour of C casts:  "The same
semantic restrictions and behaviors apply, with the exception that in
performing a static_cast in the following situations the conversion is
valid even if the base class is inaccessible" .

Therefore, C casts can cast as if by static_cast to inaccessible types
even where static_cast cannot.


No worries, a Standard reference is a good enough jumping-off point! I'll be sure to start reading that just when I want to go to sleep. :) Definitely sounds like another corner of the C/C++ maze that I didn't know about yet. Thanks.
 



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