This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] Add constexpr specifiers to std::shared_ptr, std::unique_ptr, etc


Here's the fix to allow unique_ptr to use deleters of pointer type.

ptr_deleter.cc tests the functionality, ptr_deleter_neg.cc checks that
it's ill-formed to construct such a unique_ptr without supplying a
deleter. That has XFAILs until we can use a static_assert in the
constexpr constructors, which depends on c++/46382

I've also changed the constexpr constructors to value-initialize the
tuple member, because only tuple's default constructor is constexpr.

2010-11-08  Jonathan Wakely  <jwakely.gcc@gmail.com>

        * include/bits/unique_ptr.h: Move misplaced static_assert and use
        tuple's constexpr constructor in constexpr constructors.
        * testsuite/20_util/unique_ptr/cons/ptr_deleter.cc: New.
        * testsuite/20_util/unique_ptr/cons/ptr_deleter_neg.cc: New.

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]