mirror of
https://github.com/boostorg/callable_traits.git
synced 2026-01-23 05:22:13 +00:00
63 lines
1.7 KiB
C++
63 lines
1.7 KiB
C++
#include <tuple>
|
|
#include <utility>
|
|
#include <type_traits>
|
|
#include <boost/callable_traits/clear_args.hpp>
|
|
#include "test.hpp"
|
|
|
|
struct foo;
|
|
|
|
int main() {
|
|
|
|
{
|
|
using f = void(int, int, int, int, int);
|
|
using test = clear_args_t<f>;
|
|
using expect = void();
|
|
CT_ASSERT(std::is_same<test, expect>::value);
|
|
}
|
|
|
|
#ifndef CALLABLE_TRAITS_DISABLE_ABOMINABLE_FUNCTIONS
|
|
{
|
|
using f = void(int, int, int, int, int) const;
|
|
using test = clear_args_t<f>;
|
|
using expect = void() const;
|
|
CT_ASSERT(std::is_same<test, expect>::value);
|
|
}
|
|
#endif // #ifndef CALLABLE_TRAITS_DISABLE_ABOMINABLE_FUNCTIONS
|
|
|
|
{
|
|
using f = void(*)(int, int, int, int, int);
|
|
using test = clear_args_t<f>;
|
|
using expect = void(*)();
|
|
CT_ASSERT(std::is_same<test, expect>::value);
|
|
}
|
|
|
|
{
|
|
using f = void(&)(int, int, int, int, int);
|
|
using test = clear_args_t<f>;
|
|
using expect = void(&)();
|
|
CT_ASSERT(std::is_same<test, expect>::value);
|
|
}
|
|
|
|
{
|
|
using f = void(&)(int, int, int, int, int);
|
|
using test = clear_args_t<f>;
|
|
using expect = void(&)();
|
|
CT_ASSERT(std::is_same<test, expect>::value);
|
|
}
|
|
|
|
{
|
|
using f = void(foo::*)(int, int, int, int, int);
|
|
using test = clear_args_t<f>;
|
|
using expect = void(foo::*)();
|
|
CT_ASSERT(std::is_same<test, expect>::value);
|
|
}
|
|
|
|
{
|
|
using f = void(foo::*)(int, int, int, int, int) volatile;
|
|
using test = clear_args_t<f>;
|
|
using expect = void(foo::*)() volatile;
|
|
CT_ASSERT(std::is_same<test, expect>::value);
|
|
}
|
|
}
|
|
|