struct AllocLastTag {};
-template <class Alloc>
+template <class Self, class Alloc>
struct UsesAllocatorTestBase {
public:
using CtorAlloc = typename std::conditional<
: args_id(aid), constructor_called(UA_None), allocator()
{}
+ UsesAllocatorTestBase(UsesAllocatorTestBase const&)
+ : args_id(&makeArgumentID<Self const&>()), constructor_called(UA_None),
+ allocator()
+ {}
+
+ UsesAllocatorTestBase(UsesAllocatorTestBase&&)
+ : args_id(&makeArgumentID<Self&&>()), constructor_called(UA_None),
+ allocator()
+ {}
+
template <class ...Args>
UsesAllocatorTestBase(std::allocator_arg_t, CtorAlloc const& a, Args&&...)
: args_id(&makeArgumentID<Args&&...>()),
};
template <class Alloc, size_t Arity>
-class UsesAllocatorV1 : public UsesAllocatorTestBase<Alloc>
+class UsesAllocatorV1 : public UsesAllocatorTestBase<UsesAllocatorV1<Alloc, Arity>, Alloc>
{
public:
typedef Alloc allocator_type;
- using Base = UsesAllocatorTestBase<Alloc>;
+ using Base = UsesAllocatorTestBase<UsesAllocatorV1, Alloc>;
using CtorAlloc = typename Base::CtorAlloc;
UsesAllocatorV1() : Base(&makeArgumentID<>()) {}
template <class Alloc, size_t Arity>
-class UsesAllocatorV2 : public UsesAllocatorTestBase<Alloc>
+class UsesAllocatorV2 : public UsesAllocatorTestBase<UsesAllocatorV2<Alloc, Arity>, Alloc>
{
public:
typedef Alloc allocator_type;
- using Base = UsesAllocatorTestBase<Alloc>;
+ using Base = UsesAllocatorTestBase<UsesAllocatorV2, Alloc>;
using CtorAlloc = typename Base::CtorAlloc;
UsesAllocatorV2() : Base(&makeArgumentID<>()) {}
};
template <class Alloc, size_t Arity>
-class UsesAllocatorV3 : public UsesAllocatorTestBase<Alloc>
+class UsesAllocatorV3 : public UsesAllocatorTestBase<UsesAllocatorV3<Alloc, Arity>, Alloc>
{
public:
typedef Alloc allocator_type;
- using Base = UsesAllocatorTestBase<Alloc>;
+ using Base = UsesAllocatorTestBase<UsesAllocatorV3, Alloc>;
using CtorAlloc = typename Base::CtorAlloc;
UsesAllocatorV3() : Base(&makeArgumentID<>()) {}
};
template <class Alloc, size_t Arity>
-class NotUsesAllocator : public UsesAllocatorTestBase<Alloc>
+class NotUsesAllocator : public UsesAllocatorTestBase<NotUsesAllocator<Alloc, Arity>, Alloc>
{
public:
// no allocator_type typedef provided
- using Base = UsesAllocatorTestBase<Alloc>;
+ using Base = UsesAllocatorTestBase<NotUsesAllocator, Alloc>;
using CtorAlloc = typename Base::CtorAlloc;
NotUsesAllocator() : Base(&makeArgumentID<>()) {}