This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Why is tuple used in unique_ptr
- From: Anton Daneyko <self at mezhaka dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Mon, 11 Mar 2013 00:26:54 +0100
- Subject: Why is tuple used in unique_ptr
Dear all, I am looking at unique_ptr implementation and I wonder what
is the motivation to use tuple to hold the pointer and it's deleter,
rather than letting them be members of the unitque_ptr on their own?
It seems that doing std::get<0>(_M_t); or std::get<1>(_M_t); is less
clear, than referring to member names of pointer and deleter.