parameter container operations tests

also removing qualified_function_type
This commit is contained in:
badair
2016-04-17 14:55:15 -05:00
parent b3035945a1
commit 6fcb682491
27 changed files with 1157 additions and 73 deletions

View File

@@ -0,0 +1,41 @@
#include <tuple>
#include <utility>
#include <type_traits>
#include <callable_traits/callable_traits.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 {};
template<typename... Ts>
using sig = int(Ts...);
int main() {
{
using f = sig<N<0>, N<1>, N<2>, N<3>, N<4>>;
using test = ct::pop_front<f>;
using expect = sig<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::pop_front<f, 2>;
using expect = sig<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::pop_front<f, 5>;
using expect = sig<>;
CT_ASSERT(std::is_same<test, expect>::value);
}
}