search for: p0033r1

Displaying 2 results from an estimated 2 matches for "p0033r1".

2019 Aug 29
2
enable_shared_from_this fails at runtime when inherited privately
..., as documentations (I >> use, ie. cppreference.com) don't mention it, probably because it's not a >> requirement of the standard. > > It definitely is a requirement of the standard. The new wording we > added via http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0033r1.html#spec > says that the base's weak_ptr is only initialized when the base class > is "unambiguous and accessible". It doesn't say that an ambiguous or > inaccessible base class makes the program ill-formed, so we're not > allowed to reject such a program. > I...
2019 Aug 29
2
enable_shared_from_this fails at runtime when inherited privately
Hello, I just discovered, that, when using enable_shared_from_this and inheriting it privately, this fails at runtime. I made a small example: #include <memory> #include <boost/shared_ptr.hpp> #include <boost/make_shared.hpp> #include <boost/enable_shared_from_this.hpp> #ifndef prefix #define prefix std #endif class foo: prefix::enable_shared_from_this<foo> {