namespace macros, code cleanup

This commit is contained in:
badair
2016-06-30 23:14:32 -05:00
parent b02eb72e08
commit 9bd14cbf46
132 changed files with 1776 additions and 2266 deletions

View File

@@ -2,12 +2,8 @@
#include <utility>
#include <type_traits>
#include <callable_traits/insert_args.hpp>
#include "test.hpp"
#ifndef CT_ASSERT
#define CT_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__)
#endif //CT_ASSERT
namespace ct = callable_traits;
template<int I>
struct N {};
@@ -19,42 +15,42 @@ int main() {
{
using f = sig<N<0>, N<1>, N<2>, N<3>, N<4>>;
using test = ct::insert_args_t<0, f, int, char>;
using test = insert_args_t<0, f, int, char>;
using expect = sig<int, char, N<0>, N<1>, N<2>, N<3>, N<4>>;
CT_ASSERT(std::is_same<test, expect>::value);
}
{
using f = sig<N<0>, N<1>, N<2>, N<3>, N<4>>;
using test = ct::insert_args_t<1, f, int, char>;
using test = insert_args_t<1, f, int, char>;
using expect = sig<N<0>, int, char, N<1>, N<2>, N<3>, N<4>>;
CT_ASSERT(std::is_same<test, expect>::value);
}
{
using f = sig<N<0>, N<1>, N<2>, N<3>, N<4>>;
using test = ct::insert_args_t<2, f, int, char>;
using test = insert_args_t<2, f, int, char>;
using expect = sig<N<0>, N<1>, int, char, N<2>, N<3>, N<4>>;
CT_ASSERT(std::is_same<test, expect>::value);
}
{
using f = sig<N<0>, N<1>, N<2>, N<3>, N<4>>;
using test = ct::insert_args_t<3, f, int, char>;
using test = insert_args_t<3, f, int, char>;
using expect = sig<N<0>, N<1>, N<2>, int, char, N<3>, N<4>>;
CT_ASSERT(std::is_same<test, expect>::value);
}
{
using f = sig<N<0>, N<1>, N<2>, N<3>, N<4>>;
using test = ct::insert_args_t<4, f, int, char>;
using test = insert_args_t<4, f, int, char>;
using expect = sig<N<0>, N<1>, N<2>, N<3>, int, char, N<4>>;
CT_ASSERT(std::is_same<test, expect>::value);
}
{
using f = sig<N<0>, N<1>, N<2>, N<3>, N<4>>;
using test = ct::insert_args_t<5, f, int, char>;
using test = insert_args_t<5, f, int, char>;
using expect = sig<N<0>, N<1>, N<2>, N<3>, N<4>, int, char>;
CT_ASSERT(std::is_same<test, expect>::value);
}