Boost logo

Boost Users :

Subject: [Boost-users] [smart_ptr] make_shared imposes const ref.
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2011-11-29 06:16:42


Why is make_shared declared as

template<typename T, typename Arg1 > shared_ptr<T> make_shared( Arg1
const & arg1 );

rather than

template<typename T, typename Arg1 > shared_ptr<T> make_shared( Arg1 arg1 );

since the effect is that if you have a constructor that takes
non-const references you
cannot use make_shared( ) on it.

Thx,

- Rob.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net