Refactor test archetypes implementation.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278319 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-08-11 07:04:14 +00:00
parent a60053b9ee
commit 92741e2493
8 changed files with 206 additions and 164 deletions

View File

@@ -22,6 +22,7 @@
#include "archetypes.hpp"
#include "test_convertible.hpp"
using namespace ImplicitTypes; // Get implicitly archetypes
template <class T1, class T1Arg,
bool CanCopy = true, bool CanConvert = CanCopy>
@@ -58,20 +59,20 @@ int main()
// Test non-const lvalue and rvalue types
test_sfinae<AllCtors, AllCtors&>();
test_sfinae<AllCtors, AllCtors&&>();
test_sfinae<ExplicitAllCtors, ExplicitAllCtors&, true, false>();
test_sfinae<ExplicitAllCtors, ExplicitAllCtors&&, true, false>();
test_sfinae<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors&, true, false>();
test_sfinae<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors&&, true, false>();
test_sfinae<CopyOnly, CopyOnly&>();
test_sfinae<CopyOnly, CopyOnly&&>();
test_sfinae<ExplicitCopyOnly, ExplicitCopyOnly&, true, false>();
test_sfinae<ExplicitCopyOnly, ExplicitCopyOnly&&, true, false>();
test_sfinae<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly&, true, false>();
test_sfinae<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly&&, true, false>();
test_sfinae<MoveOnly, MoveOnly&, false>();
test_sfinae<MoveOnly, MoveOnly&&>();
test_sfinae<ExplicitMoveOnly, ExplicitMoveOnly&, false>();
test_sfinae<ExplicitMoveOnly, ExplicitMoveOnly&&, true, false>();
test_sfinae<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly&, false>();
test_sfinae<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly&&, true, false>();
test_sfinae<NonCopyable, NonCopyable&, false>();
test_sfinae<NonCopyable, NonCopyable&&, false>();
test_sfinae<ExplicitNonCopyable, ExplicitNonCopyable&, false>();
test_sfinae<ExplicitNonCopyable, ExplicitNonCopyable&&, false>();
test_sfinae<ExplicitTypes::NonCopyable, ExplicitTypes::NonCopyable&, false>();
test_sfinae<ExplicitTypes::NonCopyable, ExplicitTypes::NonCopyable&&, false>();
}
{
// Test converting types
@@ -79,10 +80,10 @@ int main()
test_sfinae<ConvertingType, const int&>();
test_sfinae<ConvertingType, int&&>();
test_sfinae<ConvertingType, const int&&>();
test_sfinae<ExplicitConvertingType, int&, true, false>();
test_sfinae<ExplicitConvertingType, const int&, true, false>();
test_sfinae<ExplicitConvertingType, int&&, true, false>();
test_sfinae<ExplicitConvertingType, const int&&, true, false>();
test_sfinae<ExplicitTypes::ConvertingType, int&, true, false>();
test_sfinae<ExplicitTypes::ConvertingType, const int&, true, false>();
test_sfinae<ExplicitTypes::ConvertingType, int&&, true, false>();
test_sfinae<ExplicitTypes::ConvertingType, const int&&, true, false>();
}
#if TEST_STD_VER > 11
{ // explicit constexpr test

View File

@@ -20,6 +20,7 @@
#include "archetypes.hpp"
#include "test_convertible.hpp"
using namespace ImplicitTypes; // Get implicitly archetypes
struct ExplicitT {
constexpr explicit ExplicitT(int x) : value(x) {}
@@ -62,13 +63,13 @@ int main()
}
{
test_sfinae<AllCtors>();
test_sfinae<ExplicitAllCtors, true, false>();
test_sfinae<ExplicitTypes::AllCtors, true, false>();
test_sfinae<CopyOnly>();
test_sfinae<ExplicitCopyOnly, true, false>();
test_sfinae<ExplicitTypes::CopyOnly, true, false>();
test_sfinae<MoveOnly, false>();
test_sfinae<ExplicitMoveOnly, false>();
test_sfinae<ExplicitTypes::MoveOnly, false>();
test_sfinae<NonCopyable, false>();
test_sfinae<ExplicitNonCopyable, false>();
test_sfinae<ExplicitTypes::NonCopyable, false>();
}
#if TEST_STD_VER > 11
{

View File

@@ -20,6 +20,7 @@
#include "archetypes.hpp"
#include "test_convertible.hpp"
using namespace ImplicitTypes; // Get implicitly archetypes
template <class T1, class U1,
bool CanCopy = true, bool CanConvert = CanCopy>
@@ -79,27 +80,27 @@ int main()
test_pair_const<AllCtors, const AllCtors&>();
test_pair_const<AllCtors, const AllCtors&&>();
test_pair_const<ExplicitAllCtors, ExplicitAllCtors>(); // copy construction
test_pair_const<ExplicitAllCtors, ExplicitAllCtors&, true, false>();
test_pair_const<ExplicitAllCtors, ExplicitAllCtors&&, true, false>();
test_pair_const<ExplicitAllCtors, const ExplicitAllCtors&, true, false>();
test_pair_const<ExplicitAllCtors, const ExplicitAllCtors&&, true, false>();
test_pair_const<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors>(); // copy construction
test_pair_const<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors&, true, false>();
test_pair_const<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors&&, true, false>();
test_pair_const<ExplicitTypes::AllCtors, const ExplicitTypes::AllCtors&, true, false>();
test_pair_const<ExplicitTypes::AllCtors, const ExplicitTypes::AllCtors&&, true, false>();
test_pair_const<MoveOnly, MoveOnly, false>(); // copy construction
test_pair_const<MoveOnly, MoveOnly&, false>();
test_pair_const<MoveOnly, MoveOnly&&, false>();
test_pair_const<ExplicitMoveOnly, ExplicitMoveOnly, false>(); // copy construction
test_pair_const<ExplicitMoveOnly, ExplicitMoveOnly&, false>();
test_pair_const<ExplicitMoveOnly, ExplicitMoveOnly&&, false>();
test_pair_const<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly, false>(); // copy construction
test_pair_const<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly&, false>();
test_pair_const<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly&&, false>();
test_pair_const<CopyOnly, CopyOnly>();
test_pair_const<CopyOnly, CopyOnly&>();
test_pair_const<CopyOnly, CopyOnly&&>();
test_pair_const<ExplicitCopyOnly, ExplicitCopyOnly>();
test_pair_const<ExplicitCopyOnly, ExplicitCopyOnly&, true, false>();
test_pair_const<ExplicitCopyOnly, ExplicitCopyOnly&&, true, false>();
test_pair_const<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly>();
test_pair_const<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly&, true, false>();
test_pair_const<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly&&, true, false>();
test_pair_const<NonCopyable, NonCopyable, false>();
test_pair_const<NonCopyable, NonCopyable&, false>();
@@ -116,23 +117,23 @@ int main()
test_pair_const<NonCopyable&&, NonCopyable&&, false>();
test_pair_const<ConvertingType&, int, false>();
test_pair_const<ExplicitConvertingType&, int, false>();
test_pair_const<ExplicitTypes::ConvertingType&, int, false>();
// Unfortunately the below conversions are allowed and create dangling
// references.
//test_pair_const<ConvertingType&&, int>();
//test_pair_const<ConvertingType const&, int>();
//test_pair_const<ConvertingType const&&, int>();
// But these are not because the converting constructor is explicit.
test_pair_const<ExplicitConvertingType&&, int, false>();
test_pair_const<ExplicitConvertingType const&, int, false>();
test_pair_const<ExplicitConvertingType const&&, int, false>();
test_pair_const<ExplicitTypes::ConvertingType&&, int, false>();
test_pair_const<ExplicitTypes::ConvertingType const&, int, false>();
test_pair_const<ExplicitTypes::ConvertingType const&&, int, false>();
}
{
test_pair_const<AllCtors, int, false>();
test_pair_const<ExplicitAllCtors, int, false>();
test_pair_const<ExplicitTypes::AllCtors, int, false>();
test_pair_const<ConvertingType, int>();
test_pair_const<ExplicitConvertingType, int, true, false>();
test_pair_const<ExplicitTypes::ConvertingType, int, true, false>();
test_pair_const<ConvertingType, int>();
test_pair_const<ConvertingType, ConvertingType>();
@@ -140,16 +141,16 @@ int main()
test_pair_const<ConvertingType, ConvertingType&>();
test_pair_const<ConvertingType, ConvertingType&&>();
test_pair_const<ExplicitConvertingType, int, true, false>();
test_pair_const<ExplicitConvertingType, int&, true, false>();
test_pair_const<ExplicitConvertingType, const int&, true, false>();
test_pair_const<ExplicitConvertingType, int&&, true, false>();
test_pair_const<ExplicitConvertingType, const int&&, true, false>();
test_pair_const<ExplicitTypes::ConvertingType, int, true, false>();
test_pair_const<ExplicitTypes::ConvertingType, int&, true, false>();
test_pair_const<ExplicitTypes::ConvertingType, const int&, true, false>();
test_pair_const<ExplicitTypes::ConvertingType, int&&, true, false>();
test_pair_const<ExplicitTypes::ConvertingType, const int&&, true, false>();
test_pair_const<ExplicitConvertingType, ExplicitConvertingType>();
test_pair_const<ExplicitConvertingType, ExplicitConvertingType const&, true, false>();
test_pair_const<ExplicitConvertingType, ExplicitConvertingType&, true, false>();
test_pair_const<ExplicitConvertingType, ExplicitConvertingType&&, true, false>();
test_pair_const<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType>();
test_pair_const<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType const&, true, false>();
test_pair_const<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType&, true, false>();
test_pair_const<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType&&, true, false>();
}
#if TEST_STD_VER > 11
{

View File

@@ -28,6 +28,7 @@
#include "test_macros.h"
#include "archetypes.hpp"
using namespace ImplicitTypes; // Get implicitly archetypes
int main()
{

View File

@@ -21,6 +21,7 @@
#include "archetypes.hpp"
#include "test_convertible.hpp"
using namespace ImplicitTypes; // Get implicitly archetypes
template <class T1, class U1,
bool CanCopy = true, bool CanConvert = CanCopy>
@@ -89,27 +90,27 @@ int main()
test_pair_rv<AllCtors, const AllCtors&>();
test_pair_rv<AllCtors, const AllCtors&&>();
test_pair_rv<ExplicitAllCtors, ExplicitAllCtors>();
test_pair_rv<ExplicitAllCtors, ExplicitAllCtors&, true, false>();
test_pair_rv<ExplicitAllCtors, ExplicitAllCtors&&, true, false>();
test_pair_rv<ExplicitAllCtors, const ExplicitAllCtors&, true, false>();
test_pair_rv<ExplicitAllCtors, const ExplicitAllCtors&&, true, false>();
test_pair_rv<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors>();
test_pair_rv<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors&, true, false>();
test_pair_rv<ExplicitTypes::AllCtors, ExplicitTypes::AllCtors&&, true, false>();
test_pair_rv<ExplicitTypes::AllCtors, const ExplicitTypes::AllCtors&, true, false>();
test_pair_rv<ExplicitTypes::AllCtors, const ExplicitTypes::AllCtors&&, true, false>();
test_pair_rv<MoveOnly, MoveOnly>();
test_pair_rv<MoveOnly, MoveOnly&, false>();
test_pair_rv<MoveOnly, MoveOnly&&>();
test_pair_rv<ExplicitMoveOnly, ExplicitMoveOnly>(); // copy construction
test_pair_rv<ExplicitMoveOnly, ExplicitMoveOnly&, false>();
test_pair_rv<ExplicitMoveOnly, ExplicitMoveOnly&&, true, false>();
test_pair_rv<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly>(); // copy construction
test_pair_rv<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly&, false>();
test_pair_rv<ExplicitTypes::MoveOnly, ExplicitTypes::MoveOnly&&, true, false>();
test_pair_rv<CopyOnly, CopyOnly>();
test_pair_rv<CopyOnly, CopyOnly&>();
test_pair_rv<CopyOnly, CopyOnly&&>();
test_pair_rv<ExplicitCopyOnly, ExplicitCopyOnly>();
test_pair_rv<ExplicitCopyOnly, ExplicitCopyOnly&, true, false>();
test_pair_rv<ExplicitCopyOnly, ExplicitCopyOnly&&, true, false>();
test_pair_rv<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly>();
test_pair_rv<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly&, true, false>();
test_pair_rv<ExplicitTypes::CopyOnly, ExplicitTypes::CopyOnly&&, true, false>();
test_pair_rv<NonCopyable, NonCopyable, false>();
test_pair_rv<NonCopyable, NonCopyable&, false>();
@@ -125,22 +126,22 @@ int main()
test_pair_rv<NonCopyable&&, NonCopyable&&>();
test_pair_rv<ConvertingType&, int, false>();
test_pair_rv<ExplicitConvertingType&, int, false>();
test_pair_rv<ExplicitTypes::ConvertingType&, int, false>();
// Unfortunately the below conversions are allowed and create dangling
// references.
//test_pair_rv<ConvertingType&&, int>();
//test_pair_rv<ConvertingType const&, int>();
//test_pair_rv<ConvertingType const&&, int>();
// But these are not because the converting constructor is explicit.
test_pair_rv<ExplicitConvertingType&&, int, false>();
test_pair_rv<ExplicitConvertingType const&, int, false>();
test_pair_rv<ExplicitConvertingType const&&, int, false>();
test_pair_rv<ExplicitTypes::ConvertingType&&, int, false>();
test_pair_rv<ExplicitTypes::ConvertingType const&, int, false>();
test_pair_rv<ExplicitTypes::ConvertingType const&&, int, false>();
}
{
test_pair_rv<AllCtors, int, false>();
test_pair_rv<ExplicitAllCtors, int, false>();
test_pair_rv<ExplicitTypes::AllCtors, int, false>();
test_pair_rv<ConvertingType, int>();
test_pair_rv<ExplicitConvertingType, int, true, false>();
test_pair_rv<ExplicitTypes::ConvertingType, int, true, false>();
test_pair_rv<ConvertingType, int>();
test_pair_rv<ConvertingType, ConvertingType>();
@@ -148,16 +149,16 @@ int main()
test_pair_rv<ConvertingType, ConvertingType&>();
test_pair_rv<ConvertingType, ConvertingType&&>();
test_pair_rv<ExplicitConvertingType, int, true, false>();
test_pair_rv<ExplicitConvertingType, int&, true, false>();
test_pair_rv<ExplicitConvertingType, const int&, true, false>();
test_pair_rv<ExplicitConvertingType, int&&, true, false>();
test_pair_rv<ExplicitConvertingType, const int&&, true, false>();
test_pair_rv<ExplicitTypes::ConvertingType, int, true, false>();
test_pair_rv<ExplicitTypes::ConvertingType, int&, true, false>();
test_pair_rv<ExplicitTypes::ConvertingType, const int&, true, false>();
test_pair_rv<ExplicitTypes::ConvertingType, int&&, true, false>();
test_pair_rv<ExplicitTypes::ConvertingType, const int&&, true, false>();
test_pair_rv<ExplicitConvertingType, ExplicitConvertingType>();
test_pair_rv<ExplicitConvertingType, ExplicitConvertingType const&, true, false>();
test_pair_rv<ExplicitConvertingType, ExplicitConvertingType&, true, false>();
test_pair_rv<ExplicitConvertingType, ExplicitConvertingType&&, true, false>();
test_pair_rv<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType>();
test_pair_rv<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType const&, true, false>();
test_pair_rv<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType&, true, false>();
test_pair_rv<ExplicitTypes::ConvertingType, ExplicitTypes::ConvertingType&&, true, false>();
}
#if TEST_STD_VER > 11
{ // explicit constexpr test

View File

@@ -26,6 +26,7 @@
#include <tuple>
#include "archetypes.hpp"
using namespace ImplicitTypes; // Get implicitly archetypes
namespace ConstructorTest {

View File

@@ -5,105 +5,32 @@
#if TEST_STD_VER >= 11
struct NoDefault {
NoDefault() = delete;
};
//============================================================================//
// Trivial Implicit Test Types
namespace ImplicitTypes {
#include "archetypes.ipp"
}
// Implicit copy/move types
//============================================================================//
// Trivial Explicit Test Types
namespace ExplicitTypes {
#define DEFINE_EXPLICIT explicit
#include "archetypes.ipp"
}
struct AllCtors {
AllCtors() = default;
AllCtors(AllCtors const&) = default;
AllCtors(AllCtors &&) = default;
AllCtors& operator=(AllCtors const&) = default;
AllCtors& operator=(AllCtors &&) = default;
};
//============================================================================//
// Non-Trivial Implicit Test Types
namespace NonLiteralTypes {
#define DEFINE_DTOR(Name) ~Name() {}
#include "archetypes.ipp"
}
struct Copyable {
Copyable() = default;
Copyable(Copyable const &) = default;
Copyable &operator=(Copyable const &) = default;
};
struct CopyOnly {
CopyOnly() = default;
CopyOnly(CopyOnly const &) = default;
CopyOnly &operator=(CopyOnly const &) = default;
CopyOnly(CopyOnly &&) = delete;
CopyOnly &operator=(CopyOnly &&) = delete;
};
struct NonCopyable {
NonCopyable() = default;
NonCopyable(NonCopyable const &) = delete;
NonCopyable &operator=(NonCopyable const &) = delete;
};
struct MoveOnly {
MoveOnly() = default;
MoveOnly(MoveOnly &&) = default;
MoveOnly &operator=(MoveOnly &&) = default;
};
struct ConvertingType {
ConvertingType() = default;
ConvertingType(ConvertingType const&) = default;
ConvertingType(ConvertingType &&) = default;
ConvertingType& operator=(ConvertingType const&) = default;
ConvertingType& operator=(ConvertingType &&) = default;
template <class ...Args>
ConvertingType(Args&&...) {}
template <class Arg>
ConvertingType& operator=(Arg&&) { return *this; }
};
struct ExplicitConvertingType {
ExplicitConvertingType() = default;
explicit ExplicitConvertingType(ExplicitConvertingType const&) = default;
explicit ExplicitConvertingType(ExplicitConvertingType &&) = default;
ExplicitConvertingType& operator=(ExplicitConvertingType const&) = default;
ExplicitConvertingType& operator=(ExplicitConvertingType &&) = default;
template <class ...Args>
explicit ExplicitConvertingType(Args&&...) {}
template <class Arg>
ExplicitConvertingType& operator=(Arg&&) { return *this; }
};
// Explicit copy/move types
struct ExplicitAllCtors {
explicit ExplicitAllCtors() = default;
explicit ExplicitAllCtors(ExplicitAllCtors const&) = default;
explicit ExplicitAllCtors(ExplicitAllCtors &&) = default;
ExplicitAllCtors& operator=(ExplicitAllCtors const&) = default;
ExplicitAllCtors& operator=(ExplicitAllCtors &&) = default;
};
struct ExplicitCopyable {
explicit ExplicitCopyable() = default;
explicit ExplicitCopyable(ExplicitCopyable const &) = default;
ExplicitCopyable &operator=(ExplicitCopyable const &) = default;
};
struct ExplicitCopyOnly {
explicit ExplicitCopyOnly() = default;
explicit ExplicitCopyOnly(ExplicitCopyOnly const &) = default;
ExplicitCopyOnly &operator=(ExplicitCopyOnly const &) = default;
explicit ExplicitCopyOnly(ExplicitCopyOnly &&) = delete;
ExplicitCopyOnly &operator=(ExplicitCopyOnly &&) = delete;
};
struct ExplicitNonCopyable {
explicit ExplicitNonCopyable() = default;
explicit ExplicitNonCopyable(ExplicitNonCopyable const &) = delete;
ExplicitNonCopyable &operator=(ExplicitNonCopyable const &) = delete;
};
struct ExplicitMoveOnly {
explicit ExplicitMoveOnly() = default;
explicit ExplicitMoveOnly(ExplicitMoveOnly &&) = default;
ExplicitMoveOnly &operator=(ExplicitMoveOnly &&) = default;
};
//============================================================================//
// Non-Trivially Copyable Implicit Test Types
namespace NonTrivialTypes {
#define DEFINE_CTOR {}
#include "archetypes.ipp"
}
#endif // TEST_STD_VER >= 11

109
test/support/archetypes.ipp Normal file
View File

@@ -0,0 +1,109 @@
#ifndef DEFINE_EXPLICIT
#define DEFINE_EXPLICIT
#endif
#ifndef DEFINE_CTOR
#define DEFINE_CTOR = default
#endif
#ifndef DEFINE_ASSIGN
#define DEFINE_ASSIGN = default
#endif
#ifndef DEFINE_DTOR
#define DEFINE_DTOR(Name)
#endif
struct NoDefault {
DEFINE_EXPLICIT NoDefault() = delete;
DEFINE_DTOR(NoDefault)
};
struct AllCtors {
DEFINE_EXPLICIT AllCtors() DEFINE_CTOR;
DEFINE_EXPLICIT AllCtors(AllCtors const&) DEFINE_CTOR;
DEFINE_EXPLICIT AllCtors(AllCtors &&) DEFINE_CTOR;
AllCtors& operator=(AllCtors const&) DEFINE_ASSIGN;
AllCtors& operator=(AllCtors &&) DEFINE_ASSIGN;
DEFINE_DTOR(AllCtors)
};
struct Copyable {
DEFINE_EXPLICIT Copyable() DEFINE_CTOR;
DEFINE_EXPLICIT Copyable(Copyable const &) DEFINE_CTOR;
Copyable &operator=(Copyable const &) DEFINE_ASSIGN;
DEFINE_DTOR(Copyable)
};
struct CopyOnly {
DEFINE_EXPLICIT CopyOnly() DEFINE_CTOR;
DEFINE_EXPLICIT CopyOnly(CopyOnly const &) DEFINE_CTOR;
DEFINE_EXPLICIT CopyOnly(CopyOnly &&) = delete;
CopyOnly &operator=(CopyOnly const &) DEFINE_ASSIGN;
CopyOnly &operator=(CopyOnly &&) = delete;
DEFINE_DTOR(CopyOnly)
};
struct NonCopyable {
DEFINE_EXPLICIT NonCopyable() DEFINE_CTOR;
DEFINE_EXPLICIT NonCopyable(NonCopyable const &) = delete;
NonCopyable &operator=(NonCopyable const &) = delete;
DEFINE_DTOR(NonCopyable)
};
struct MoveOnly {
DEFINE_EXPLICIT MoveOnly() DEFINE_CTOR;
DEFINE_EXPLICIT MoveOnly(MoveOnly &&) DEFINE_CTOR;
MoveOnly &operator=(MoveOnly &&) DEFINE_ASSIGN;
DEFINE_DTOR(MoveOnly)
};
struct CopyAssignable {
DEFINE_EXPLICIT CopyAssignable() = delete;
CopyAssignable& operator=(CopyAssignable const&) DEFINE_ASSIGN;
DEFINE_DTOR(CopyAssignable)
};
struct CopyAssignOnly {
DEFINE_EXPLICIT CopyAssignOnly() = delete;
CopyAssignOnly& operator=(CopyAssignOnly const&) DEFINE_ASSIGN;
CopyAssignOnly& operator=(CopyAssignOnly &&) = delete;
DEFINE_DTOR(CopyAssignOnly)
};
struct MoveAssignOnly {
DEFINE_EXPLICIT MoveAssignOnly() = delete;
MoveAssignOnly& operator=(MoveAssignOnly const&) = delete;
MoveAssignOnly& operator=(MoveAssignOnly &&) DEFINE_ASSIGN;
DEFINE_DTOR(MoveAssignOnly)
};
struct ConvertingType {
DEFINE_EXPLICIT ConvertingType() DEFINE_CTOR;
DEFINE_EXPLICIT ConvertingType(ConvertingType const&) DEFINE_CTOR;
DEFINE_EXPLICIT ConvertingType(ConvertingType &&) DEFINE_CTOR;
ConvertingType& operator=(ConvertingType const&) DEFINE_ASSIGN;
ConvertingType& operator=(ConvertingType &&) DEFINE_ASSIGN;
template <class ...Args>
DEFINE_EXPLICIT ConvertingType(Args&&...) {}
template <class Arg>
ConvertingType& operator=(Arg&&) { return *this; }
DEFINE_DTOR(ConvertingType)
};
template <template <class...> class List>
using ApplyTypes = List<
NoDefault,
AllCtors,
Copyable,
CopyOnly,
NonCopyable,
MoveOnly,
CopyAssignable,
CopyAssignOnly,
MoveAssignOnly,
ConvertingType
>;
#undef DEFINE_EXPLICIT
#undef DEFINE_CTOR
#undef DEFINE_ASSIGN
#undef DEFINE_DTOR