diff --git a/doc/html/callable_traits/headers.html b/doc/html/callable_traits/headers.html index 53b60fc..2165171 100644 --- a/doc/html/callable_traits/headers.html +++ b/doc/html/callable_traits/headers.html @@ -144,13 +144,13 @@ #include<callable_traits/arg_at.hpp>
  • - #include<callable_traits/insert_at.hpp> + #include<callable_traits/insert_args.hpp>
  • - #include<callable_traits/replace_arg.hpp> + #include<callable_traits/replace_args.hpp>
  • - #include<callable_traits/remove_at.hpp> + #include<callable_traits/remove_args.hpp>
  • #include<callable_traits/clear_args.hpp> diff --git a/doc/html/callable_traits/ref_args.html b/doc/html/callable_traits/ref_args.html index 43bbbec..f531a6c 100644 --- a/doc/html/callable_traits/ref_args.html +++ b/doc/html/callable_traits/ref_args.html @@ -122,48 +122,63 @@ namespace ct = callable_traits; -// all callable types in this example use these parameter types -using expect = std::tuple<int, float&, const char*>; - -template<typename T> +template<typename T, typename Expect> void test(){ // this example shows how callable_traits::args // bevaves consistently for many different types using args = ct::args<T>; - static_assert(std::is_same<expect, args>{}, ""); } int main() { + { + auto lamda = [](int, float&, const char*){}; + using lam = decltype(lamda); + using expect = std::tuple<int, float&, const char*>; - auto lamda = [](int, float&, const char*){}; - using lam = decltype(lamda); - test<lam>(); - test<lam&>(); - test<lam&&>(); - test<lam const &>(); + test<lam, expect>(); + test<lam&, expect>(); + test<lam&&, expect>(); + test<lam const &, expect>(); + } - struct foo; - using pmf = void(foo::*)(int, float&, const char*); - test<pmf>(); - test<pmf&>(); - test<pmf&&>(); - test<pmf const &>(); + { + struct foo; + using pmf = void(foo::*)(int, float&, const char*); + using expect = std::tuple<foo&, int, float&, const char*>; - using function_ptr = void(*)(int, float&, const char*); - test<function_ptr>(); - test<function_ptr&>(); - test<function_ptr&&>(); - test<function_ptr const &>(); + test<pmf, expect>(); + test<pmf&, expect>(); + test<pmf&&, expect>(); + test<pmf const &, expect>(); + } - using function_ref = void(&)(int, float&, const char*); - test<function_ref>(); + { + using function_ptr = void(*)(int, float&, const char*); + using expect = std::tuple<int, float&, const char*>; + test<function_ptr, expect>(); + test<function_ptr&, expect>(); + test<function_ptr&&, expect>(); + test<function_ptr const &, expect>(); + } - using function = void(int, float&, const char*); - test<function>(); + { + using function_ref = void(&)(int, float&, const char*); + using expect = std::tuple<int, float&, const char*>; + test<function_ref, expect>(); + } - using abominable = void(int, float&, const char*) const; - test<abominable>(); + { + using function = void(int, float&, const char*); + using expect = std::tuple<int, float&, const char*>; + test<function, expect>(); + } + + { + using abominable = void(int, float&, const char*) const; + using expect = std::tuple<int, float&, const char*>; + test<abominable, expect>(); + } }

    diff --git a/doc/html/callable_traits/ref_clear_args.html b/doc/html/callable_traits/ref_clear_args.html index 13a274c..e575d13 100644 --- a/doc/html/callable_traits/ref_clear_args.html +++ b/doc/html/callable_traits/ref_clear_args.html @@ -7,7 +7,7 @@ - + @@ -20,7 +20,7 @@

    -PrevUpHomeNext +PrevUpHomeNext

    @@ -93,7 +93,7 @@
    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/callable_traits/ref_expand_args.html b/doc/html/callable_traits/ref_expand_args.html index 9df3f07..427f8ee 100644 --- a/doc/html/callable_traits/ref_expand_args.html +++ b/doc/html/callable_traits/ref_expand_args.html @@ -6,7 +6,7 @@ - + @@ -20,7 +20,7 @@
    -PrevUpHomeNext +PrevUpHomeNext

    @@ -128,7 +128,7 @@
    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/callable_traits/ref_insert_at.html b/doc/html/callable_traits/ref_insert_args.html similarity index 77% rename from doc/html/callable_traits/ref_insert_at.html rename to doc/html/callable_traits/ref_insert_args.html index 59394b7..8647e4b 100644 --- a/doc/html/callable_traits/ref_insert_at.html +++ b/doc/html/callable_traits/ref_insert_args.html @@ -1,13 +1,13 @@ -insert_at +insert_args - + @@ -20,32 +20,32 @@

    -PrevUpHomeNext +PrevUpHomeNext
    namespace callable_traits {
     
         template<std::size_t InsertIndex, typename T, typename... NewArgs>
    -    using insert_at = /* implementation-defined */ ;
    +    using insert_args = /* implementation-defined */ ;
     }
     

    - - Constraints + + Constraints

    - - Behavior + + Behavior

    • - insert_at<Index, T, NewArgs...> aliases a type identical to T, except that NewArgs... will be inserted into the [Args...] + insert_args<Index, T, NewArgs...> aliases a type identical to T, except that NewArgs... will be inserted into the [Args...] parameter list at the 0-based InsertIndex. TODO document out-of-bounds behavior
    • @@ -55,11 +55,11 @@

    - - Example + + Example

    #include <type_traits>
    -#include <callable_traits/insert_at.hpp>
    +#include <callable_traits/insert_args.hpp>
     
     namespace ct = callable_traits;
     
    @@ -69,7 +69,7 @@
     int main() {
     
         using f = int(*)(N<0>, N<1>, N<2>, N<3>);
    -    using test = ct::insert_at<1, f, int>;
    +    using test = ct::insert_args<1, f, int>;
         using expect = int(*)(N<0>, int, N<1>, N<2>, N<3>);
         static_assert(std::is_same<test, expect>::value, "");
     }
    @@ -85,7 +85,7 @@
     
     
    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/callable_traits/ref_remove_at.html b/doc/html/callable_traits/ref_remove_args.html similarity index 76% rename from doc/html/callable_traits/ref_remove_at.html rename to doc/html/callable_traits/ref_remove_args.html index 05665fe..da0fcc5 100644 --- a/doc/html/callable_traits/ref_remove_at.html +++ b/doc/html/callable_traits/ref_remove_args.html @@ -1,12 +1,12 @@ -remove_at +remove_args - + @@ -20,32 +20,32 @@
    -PrevUpHomeNext +PrevUpHomeNext
    namespace callable_traits {
     
         template<std::size_t StartIndex, typename T, std::size_t Count = 1>
    -    using remove_at = /* implementation-defined */ ;
    +    using remove_args = /* implementation-defined */ ;
     }
     

    - - Constraints + + Constraints

    - - Behavior + + Behavior

    • - remove_at<Index, Callable, Count> + remove_args<Index, Callable, Count> aliases a type identical to T, except that all parameter types in the parameter list will be removed from 0-based Index to Index + Count. TODO document out-of-bounds behavior @@ -56,11 +56,11 @@

    - - Example + + Example

    #include <type_traits>
    -#include <callable_traits/remove_at.hpp>
    +#include <callable_traits/remove_args.hpp>
     
     namespace ct = callable_traits;
     
    @@ -72,7 +72,7 @@
     int main() {
     
         using f = int(foo::*)(N<0>, N<1>, N<2>, N<3>);
    -    using test = ct::remove_at<2, f>;
    +    using test = ct::remove_args<2, f>;
         using expect = int(foo::*)(N<0>, N<1>, N<3>);
         static_assert(std::is_same<test, expect>::value, "");
     }
    @@ -88,7 +88,7 @@
     
     
    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/callable_traits/ref_replace_arg.html b/doc/html/callable_traits/ref_replace_args.html similarity index 70% rename from doc/html/callable_traits/ref_replace_arg.html rename to doc/html/callable_traits/ref_replace_args.html index 04506a1..0bbe6a6 100644 --- a/doc/html/callable_traits/ref_replace_arg.html +++ b/doc/html/callable_traits/ref_replace_args.html @@ -1,13 +1,13 @@ -replace_arg +replace_args - - + + @@ -20,32 +20,32 @@

    -PrevUpHomeNext +PrevUpHomeNext
    namespace callable_traits {
     
         template<std::size_t StartIndex, typename T, typename... NewArgs>
    -    using replace_arg = /* implementation-defined */ ;
    +    using replace_args = /* implementation-defined */ ;
     }
     

    - - Constraints + + Constraints

    - - Behavior + + Behavior

    • - replace_arg<Index, T, NewArgs...> aliases a type identical to T, except that NewArgs... will begin overwriting the [Args...] + replace_args<Index, T, NewArgs...> aliases a type identical to T, except that NewArgs... will begin overwriting the [Args...] parameter list at the 0-based InsertIndex, extending the parameter list as necessary.
    • @@ -55,11 +55,11 @@

    - - Example + + Example

    #include <type_traits>
    -#include <callable_traits/replace_arg.hpp>
    +#include <callable_traits/replace_args.hpp>
     
     namespace ct = callable_traits;
     
    @@ -71,7 +71,7 @@
     int main() {
     
         using f = int(&)(N<0>, N<1>, N<2>, N<3>);
    -    using test = ct::replace_arg<2, f, int>;
    +    using test = ct::replace_args<2, f, int>;
         using expect = int(&)(N<0>, N<1>, int, N<3>);
         static_assert(std::is_same<test, expect>::value, "");
     }
    @@ -87,7 +87,7 @@
     
     
    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/callable_traits_interface_example.html b/doc/html/callable_traits_interface_example.html index fbe7d43..05359cd 100644 --- a/doc/html/callable_traits_interface_example.html +++ b/doc/html/callable_traits_interface_example.html @@ -273,9 +273,10 @@

    #include <callable_traits/arg_at.hpp>
     #include <callable_traits/result_of.hpp>
    +#include <callable_traits/pop_front.hpp>
     #include <callable_traits/push_front.hpp>
     #include <callable_traits/expand_args.hpp>
    -#include <callable_traits/replace_arg.hpp>
    +#include <callable_traits/replace_args.hpp>
     #include <callable_traits/function_type.hpp>
     #include <callable_traits/set_qualifiers.hpp>
     #include <callable_traits/qualifier_flags.hpp>
    @@ -284,6 +285,7 @@
     #include <callable_traits/remove_member_cv.hpp>
     #include <callable_traits/get_qualifier_flags.hpp>
     #include <callable_traits/apply_member_pointer.hpp>
    +#include <callable_traits/remove_member_pointer.hpp>
     #include <callable_traits/remove_member_reference.hpp>
     #include <callable_traits/qualified_parent_class_of.hpp>
     #include <callable_traits/get_member_qualifier_flags.hpp>
    @@ -313,7 +315,7 @@
     
         // The member struct erases the object reference type that is supplied by
         // function_type, which aliases an INVOKE-aware function type when
    -    // a pmf is passed to it. We overwrite the first argument (which is
    +    // a pmf is passed to it. We replace the first argument (which is
         // a reference to an object of the member ptr's parent class, as required
         // by INVOKE) with void*.
     
    @@ -335,13 +337,18 @@
             struct member_wrapper {
     
                 static inline decltype(auto)
    -            wrap(void* c, ::intrfc::forward_t<Args>... args) {
    +                wrap(void* c, ::intrfc::forward_t<Args>... args) {
                     return (reinterpret_cast<context*>(c)->*PmfValue)(args...);
                 };
             };
     
    +        // removing the member pointer so that expand_args below doesn't include
    +        // the INVOKE-required object argument
    +        using abominable_function_type = ::intrfc::ct::remove_member_pointer<Pmf>;
    +
             // expand_args is used to expand the argument types into member_wrapper
    -        using wrapper = ::intrfc::ct::expand_args<Pmf, member_wrapper>;
    +        using wrapper = ::intrfc::ct::expand_args<
    +            abominable_function_type, member_wrapper>;
         };
     
         // This specialization handles member data.
    @@ -357,7 +364,7 @@
             struct wrapper {
     
                 static inline T&
    -            wrap(void* c) {
    +                wrap(void* c) {
                     return reinterpret_cast<context*>(c)->*PmdValue;
                 };
             };
    @@ -368,8 +375,8 @@
     #ifdef BOOST_PP_NIL
     
     DEFINE_INTERFACE(interface_x,
    -  (( print_member_data, void() const ))
    -  (( member_data, int ))
    +((print_member_data, void() const))
    +((member_data, int))
     );
     
     // The above macro invocation would expand to the following code (sans comments and formatting, of course):
    @@ -397,7 +404,7 @@
                     // this definition is only used for member data
                     template <typename U, typename Member = member_type,
                         bool = std::has_member_qualifiers<member_type>::value>
    -                struct member_info {
    +                    struct member_info {
     
                         using result_type = std::add_lvalue_reference_t<Member>;
                         using ptr_type = Member U::*;
    @@ -430,7 +437,7 @@
                         // overwriting the first argument with void*, "erasing" the
                         // qualified U reference. We then make it a function pointer.
                         using type_erased_ptr =
    -                        ::intrfc::ct::replace_arg<0, function_type, void*> *;
    +                        ::intrfc::ct::replace_args<0, function_type, void*> *;
                     };
     
                     // these aliases simply make later code easier to follow
    @@ -457,7 +464,7 @@
     
                     template <typename U, typename Member = member_type,
                         bool = ::intrfc::ct::is_like_function<member_type>()>
    -                struct member_info {
    +                    struct member_info {
     
                         using result_type = std::add_lvalue_reference_t<Member>;
                         using ptr_type = Member U::*;
    @@ -477,7 +484,7 @@
                             decltype(::intrfc::ct::get_member_qualifier_flags<ptr_type>());
     
                         using type_erased_ptr =
    -                        ::intrfc::ct::replace_arg<0, function_type, void *> *;
    +                        ::intrfc::ct::replace_args<0, function_type, void *> *;
                     };
     
                     using info = member_info<T>;
    @@ -499,8 +506,8 @@
             template <class T>
             inline interface_root(T &that)
                 : ptr_vtable(&vtable_holder<T>::val_vtable),
    -            obj_ptr(std::addressof(that))
    -        {}
    +            obj_ptr(std::addressof(that)) {
    +        }
     
             // This template is instantiated for every class from which this interface
             // is constructed (see constructor above). This instantiation causes the
    @@ -530,7 +537,7 @@
     
             template < ::intrfc::ct::flags QualifierFlags,
                 typename Base = get_next_base<0>>
    -        struct apply;
    +            struct apply;
     
             // for unqualified member functions/data
             template <typename Base>
    @@ -541,7 +548,7 @@
                 using Base::obj_ptr;
     
                 inline decltype(auto)
    -            print_member_data( ::intrfc::forward_t<Args>... args) {
    +                print_member_data(::intrfc::forward_t<Args>... args) {
                     return ptr_vtable->func0(obj_ptr, args...);
                 }
             };
    @@ -555,7 +562,7 @@
                 using Base::obj_ptr;
     
                 inline decltype(auto)
    -            print_member_data(::intrfc::forward_t<Args>... args) const {
    +                print_member_data(::intrfc::forward_t<Args>... args) const {
                     return ptr_vtable->func0(obj_ptr, args...);
                 }
             };
    @@ -569,7 +576,7 @@
                 using Base::obj_ptr;
     
                 inline decltype(auto)
    -            print_member_data(::intrfc::forward_t<Args>... args) volatile {
    +                print_member_data(::intrfc::forward_t<Args>... args) volatile {
                     return ptr_vtable->func0(obj_ptr, args...);
                 }
             };
    @@ -583,7 +590,7 @@
                 using Base::obj_ptr;
     
                 inline decltype(auto)
    -            print_member_data(::intrfc::forward_t<Args>... args) const volatile {
    +                print_member_data(::intrfc::forward_t<Args>... args) const volatile {
                     return ptr_vtable->func0(obj_ptr, args...);
                 }
             };
    @@ -592,8 +599,13 @@
         // this specialization helps link the bases together
         template <typename Ignored>
         struct base<0, Ignored> {
    +
    +        using function_type = ::intrfc::ct::function_type<
    +            typename interface_root::vtable::pmf0>;
    +
             using impl = ::intrfc::ct::expand_args<
    -            typename interface_root::vtable::pmf0, base_impl0>;
    +            ::intrfc::ct::pop_front<function_type>,
    +            base_impl0>;
     
             using qualifiers =
                 typename interface_root::vtable::member_info0<>::qualifiers;
    @@ -607,7 +619,7 @@
     
             template <::intrfc::ct::flags QualifierFlags,
                 typename Base = get_next_base<1>>
    -        struct apply;
    +            struct apply;
     
             template <typename Base>
             struct apply<::intrfc::ct::default_, Base> : Base {
    @@ -617,7 +629,7 @@
                 using Base::obj_ptr;
     
                 inline decltype(auto)
    -            member_data(::intrfc::forward_t<Args>... args) {
    +                member_data(::intrfc::forward_t<Args>... args) {
                     return ptr_vtable->func1(obj_ptr, args...);
                 }
             };
    @@ -630,7 +642,7 @@
                 using Base::obj_ptr;
     
                 inline decltype(auto)
    -            member_data(::intrfc::forward_t<Args>... args) const {
    +                member_data(::intrfc::forward_t<Args>... args) const {
                     return ptr_vtable->func1(obj_ptr, args...);
                 }
             };
    @@ -643,7 +655,7 @@
                 using Base::obj_ptr;
     
                 inline decltype(auto)
    -            member_data(::intrfc::forward_t<Args>... args) volatile {
    +                member_data(::intrfc::forward_t<Args>... args) volatile {
                     return ptr_vtable->func1(obj_ptr, args...);
                 }
             };
    @@ -656,7 +668,7 @@
                 using Base::obj_ptr;
     
                 inline decltype(auto)
    -            member_data(::intrfc::forward_t<Args>... args) const volatile {
    +                member_data(::intrfc::forward_t<Args>... args) const volatile {
                     return ptr_vtable->func1(obj_ptr, args...);
                 }
             };
    @@ -665,8 +677,12 @@
         template <typename Ignored>
         struct base<1, Ignored> {
     
    +        using function_type = ::intrfc::ct::function_type<
    +            typename interface_root::vtable::pmf1>;
    +
             using impl = ::intrfc::ct::expand_args<
    -            typename interface_root::vtable::pmf1, base_impl1>;
    +            ::intrfc::ct::pop_front<function_type>,
    +            base_impl1>;
     
             using qualifiers =
                 typename interface_root::vtable::member_info1<>::qualifiers;
    @@ -679,17 +695,17 @@
     // interface_x object. Member functions and member data are both handled.
     template <typename T>
     interface_x_detail::interface_root::vtable const
    -    interface_x_detail::interface_root::vtable_holder<T>::val_vtable = {
    +interface_x_detail::interface_root::vtable_holder<T>::val_vtable = {
     
    -        &::intrfc::member<
    -            typename vtable::member_info0<T>::ptr_type,
    -            &T::print_member_data
    -        >::wrapper::wrap,
    +    &::intrfc::member<
    +    typename vtable::member_info0<T>::ptr_type,
    +    &T::print_member_data
    +    >::wrapper::wrap,
     
    -        &::intrfc::member<
    -            typename vtable::member_info1<T>::ptr_type,
    -            &T::member_data
    -        >::wrapper::wrap
    +    &::intrfc::member<
    +    typename vtable::member_info1<T>::ptr_type,
    +    &T::member_data
    +    >::wrapper::wrap
     };
     
     // We inherit the base for the last member, which inherits all
    @@ -834,7 +850,7 @@
                 ::intrfc::ct::get_member_qualifier_flags<ptr_type>());     \
                                                                            \
             using type_erased_ptr =                                        \
    -            ::intrfc::ct::replace_arg<0, function_type, void*> *;     \
    +            ::intrfc::ct::replace_args<0, function_type, void*> *;     \
         };                                                                 \
                                                                            \
         using info = member_info<T>;                                       \
    @@ -882,8 +898,11 @@
     template <typename Ignored>                                            \
     struct base<i, Ignored> {                                              \
                                                                            \
    +    using function_type = ::intrfc::ct::function_type<                 \
    +        typename interface_root::vtable::BOOST_PP_CAT(pmf, i)>;        \
    +                                                                       \
         using impl = ::intrfc::ct::expand_args<                            \
    -        typename interface_root::vtable::BOOST_PP_CAT(pmf, i),         \
    +        ::intrfc::ct::pop_front<function_type>,                        \
             BOOST_PP_CAT(base_impl, i)>;                                   \
                                                                            \
         using qualifiers =                                                 \
    diff --git a/doc/html/index.html b/doc/html/index.html
    index e748a53..7b71b1d 100644
    --- a/doc/html/index.html
    +++ b/doc/html/index.html
    @@ -125,9 +125,9 @@
     
    can_invoke
    can_invoke_constexpr
    clear_args
    -
    insert_at
    -
    replace_arg
    -
    remove_at
    +
    insert_args
    +
    replace_args
    +
    remove_args
    expand_args
    function_type
    has_calling_convention
    diff --git a/doc/html/standalone_HTML.manifest b/doc/html/standalone_HTML.manifest index 26b3421..16e2f4c 100644 --- a/doc/html/standalone_HTML.manifest +++ b/doc/html/standalone_HTML.manifest @@ -23,9 +23,9 @@ callable_traits/ref_bind.html callable_traits/ref_can_invoke.html callable_traits/ref_can_invoke_constexpr.html callable_traits/ref_clear_args.html -callable_traits/ref_insert_at.html -callable_traits/ref_replace_arg.html -callable_traits/ref_remove_at.html +callable_traits/ref_insert_args.html +callable_traits/ref_replace_args.html +callable_traits/ref_remove_args.html callable_traits/ref_expand_args.html callable_traits/ref_function_type.html callable_traits/ref_has_calling_convention.html diff --git a/example/remove_at.cpp b/example/remove_args.cpp similarity index 82% rename from example/remove_at.cpp rename to example/remove_args.cpp index 1931e75..8ed4110 100644 --- a/example/remove_at.cpp +++ b/example/remove_args.cpp @@ -4,9 +4,9 @@ Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http ://boost.org/LICENSE_1_0.txt) ->*/ -//[ remove_at +//[ remove_args #include -#include +#include namespace ct = callable_traits; @@ -18,7 +18,7 @@ struct foo {}; int main() { using f = int(foo::*)(N<0>, N<1>, N<2>, N<3>); - using test = ct::remove_at<2, f>; + using test = ct::remove_args<2, f>; using expect = int(foo::*)(N<0>, N<1>, N<3>); static_assert(std::is_same::value, ""); } diff --git a/include/callable_traits/remove_args.hpp b/include/callable_traits/remove_args.hpp new file mode 100644 index 0000000..5387e16 --- /dev/null +++ b/include/callable_traits/remove_args.hpp @@ -0,0 +1,34 @@ +/*! +@file + +@copyright Barrett Adair 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) + +*/ + +#ifndef CALLABLE_TRAITS_REMOVE_ARGS_HPP +#define CALLABLE_TRAITS_REMOVE_ARGS_HPP + +#include + +namespace callable_traits { + + namespace detail { + + template + struct remove_args_error { + + static_assert(Sfinae, + "callable_traits::push_back is " + "not a meaningful operation for this T."); + }; + } + + template + using remove_args = detail::fail_if_invalid< + typename detail::traits::template remove_args, + detail::remove_args_error>; +} + +#endif //CALLABLE_TRAITS_REMOVE_ARGS_HPP diff --git a/test/remove_at_function.cpp b/test/remove_args_function.cpp similarity index 81% rename from test/remove_at_function.cpp rename to test/remove_args_function.cpp index 2b1aa91..879df43 100644 --- a/test/remove_at_function.cpp +++ b/test/remove_args_function.cpp @@ -19,63 +19,63 @@ int main() { { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<0, f>; + using test = ct::remove_args<0, f>; using expect = sig, N<2>, N<3>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<1, f>; + using test = ct::remove_args<1, f>; using expect = sig, N<2>, N<3>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<2, f>; + using test = ct::remove_args<2, f>; using expect = sig, N<1>, N<3>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<3, f>; + using test = ct::remove_args<3, f>; using expect = sig, N<1>, N<2>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<4, f>; + using test = ct::remove_args<4, f>; using expect = sig, N<1>, N<2>, N<3>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<0, f, 5>; + using test = ct::remove_args<0, f, 5>; using expect = sig<>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<0, f, 3>; + using test = ct::remove_args<0, f, 3>; using expect = sig, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<3, f, 2>; + using test = ct::remove_args<3, f, 2>; using expect = sig, N<1>, N<2>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<4, f, 1>; + using test = ct::remove_args<4, f, 1>; using expect = sig, N<1>, N<2>, N<3>>; CT_ASSERT(std::is_same::value); } diff --git a/test/remove_at_function_ptr.cpp b/test/remove_args_function_ptr.cpp similarity index 81% rename from test/remove_at_function_ptr.cpp rename to test/remove_args_function_ptr.cpp index 354d4d4..0363725 100644 --- a/test/remove_at_function_ptr.cpp +++ b/test/remove_args_function_ptr.cpp @@ -19,63 +19,63 @@ int main() { { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<0, f>; + using test = ct::remove_args<0, f>; using expect = sig, N<2>, N<3>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<1, f>; + using test = ct::remove_args<1, f>; using expect = sig, N<2>, N<3>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<2, f>; + using test = ct::remove_args<2, f>; using expect = sig, N<1>, N<3>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<3, f>; + using test = ct::remove_args<3, f>; using expect = sig, N<1>, N<2>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<4, f>; + using test = ct::remove_args<4, f>; using expect = sig, N<1>, N<2>, N<3>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<0, f, 5>; + using test = ct::remove_args<0, f, 5>; using expect = sig<>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<0, f, 3>; + using test = ct::remove_args<0, f, 3>; using expect = sig, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<3, f, 2>; + using test = ct::remove_args<3, f, 2>; using expect = sig, N<1>, N<2>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<4, f, 1>; + using test = ct::remove_args<4, f, 1>; using expect = sig, N<1>, N<2>, N<3>>; CT_ASSERT(std::is_same::value); } diff --git a/test/remove_at_function_reference.cpp b/test/remove_args_function_reference.cpp similarity index 81% rename from test/remove_at_function_reference.cpp rename to test/remove_args_function_reference.cpp index 008d590..4c77bab 100644 --- a/test/remove_at_function_reference.cpp +++ b/test/remove_args_function_reference.cpp @@ -19,63 +19,63 @@ int main() { { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<0, f>; + using test = ct::remove_args<0, f>; using expect = sig, N<2>, N<3>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<1, f>; + using test = ct::remove_args<1, f>; using expect = sig, N<2>, N<3>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<2, f>; + using test = ct::remove_args<2, f>; using expect = sig, N<1>, N<3>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<3, f>; + using test = ct::remove_args<3, f>; using expect = sig, N<1>, N<2>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<4, f>; + using test = ct::remove_args<4, f>; using expect = sig, N<1>, N<2>, N<3>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<0, f, 5>; + using test = ct::remove_args<0, f, 5>; using expect = sig<>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<0, f, 3>; + using test = ct::remove_args<0, f, 3>; using expect = sig, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<3, f, 2>; + using test = ct::remove_args<3, f, 2>; using expect = sig, N<1>, N<2>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<4, f, 1>; + using test = ct::remove_args<4, f, 1>; using expect = sig, N<1>, N<2>, N<3>>; CT_ASSERT(std::is_same::value); } diff --git a/test/remove_at_pmf.cpp b/test/remove_args_pmf.cpp similarity index 82% rename from test/remove_at_pmf.cpp rename to test/remove_args_pmf.cpp index 50ffc68..9c49951 100644 --- a/test/remove_at_pmf.cpp +++ b/test/remove_args_pmf.cpp @@ -21,63 +21,63 @@ int main() { { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<0, f>; + using test = ct::remove_args<0, f>; using expect = sig, N<2>, N<3>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<1, f>; + using test = ct::remove_args<1, f>; using expect = sig, N<2>, N<3>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<2, f>; + using test = ct::remove_args<2, f>; using expect = sig, N<1>, N<3>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<3, f>; + using test = ct::remove_args<3, f>; using expect = sig, N<1>, N<2>, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<4, f>; + using test = ct::remove_args<4, f>; using expect = sig, N<1>, N<2>, N<3>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<0, f, 5>; + using test = ct::remove_args<0, f, 5>; using expect = sig<>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<0, f, 3>; + using test = ct::remove_args<0, f, 3>; using expect = sig, N<4>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<3, f, 2>; + using test = ct::remove_args<3, f, 2>; using expect = sig, N<1>, N<2>>; CT_ASSERT(std::is_same::value); } { using f = sig, N<1>, N<2>, N<3>, N<4>>; - using test = ct::remove_at<4, f, 1>; + using test = ct::remove_args<4, f, 1>; using expect = sig, N<1>, N<2>, N<3>>; CT_ASSERT(std::is_same::value); }