Re: [Boost-bugs] [Boost C++ Libraries] #2481: make_shared and allocate_shared friendship

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2481: make_shared and allocate_shared friendship
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-12-12 17:26:41


#2481: make_shared and allocate_shared friendship
-----------------------------------------------------+----------------------
  Reporter: Michael Marcin <mike.marcin_at_[hidden]> | Owner: pdimov
      Type: Feature Requests | Status: new
 Milestone: Boost 1.38.0 | Component: smart_ptr
   Version: Boost 1.36.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------------------------+----------------------

Comment(by fmhess):

 One limitation of your solution: suppose I have private constructors and a
 static factory function for a class, and the factory function returns a
 shared_ptr. If I make make_shared_access a friend, it opens a hole where
 people can still create objects of the class without using the factory
 function by using make_shared or allocate_shared directly.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2481#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC