Implement LWG2400 - 'shared_ptr's get_deleter() should use addressof()', and add tests. Mark LWG2400 and LWG2404 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@222161 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -19,6 +19,12 @@
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||
#define DELETE_FUNCTION = delete
|
||||
#else
|
||||
#define DELETE_FUNCTION { assert(false); }
|
||||
#endif
|
||||
|
||||
struct test_deleter_base
|
||||
{
|
||||
static int count;
|
||||
@@ -46,6 +52,8 @@ public:
|
||||
void set_state(int i) {state_ = i;}
|
||||
|
||||
void operator()(T* p) {assert(state_ >= 0); ++dealloc_count; delete p;}
|
||||
|
||||
test_deleter* operator&() const DELETE_FUNCTION;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
|
Reference in New Issue
Block a user