Using libc++ I find out std::shared_ptr::make_shared()
static member function in public section. It is very handy when I have already defined type alias to std::shared_ptr
's specialization:
using T = int;
using P = std::shared_ptr< T >;
auto p = P::make_shared(123); // <=> std::make_shared< T >(123)
I'm worry about standard compliance, because articles (1, 2) from trusted source mentions nothing about static member function make_shared
of std::shared_ptr
.
Is it bad parctice to use the function currently? Why?
Aucun commentaire:
Enregistrer un commentaire