Make shared_from_this and weak_from_this private in enable_shared_from. Fixes #75.

This commit is contained in:
Peter Dimov
2020-04-02 02:16:59 +03:00
parent 7b9a969215
commit da81452f1f
4 changed files with 42 additions and 3 deletions
+16
View File
@@ -0,0 +1,16 @@
// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/shared_ptr.hpp>
#include <boost/smart_ptr/enable_shared_from.hpp>
struct X: public boost::enable_shared_from
{
};
int main()
{
boost::shared_ptr<X> px( new X );
px->shared_from_this();
}