From 926a22dd34e95cba3a4d77c4f3d4e5812aa775a0 Mon Sep 17 00:00:00 2001 From: badair Date: Thu, 7 Apr 2016 00:29:37 -0500 Subject: [PATCH] fixing individual header dependencies, quickbook doc improvements --- doc/callable_traits.qbk | 370 +++++++++++++++++- example/apply_member_pointer/example.cpp | 9 +- example/args/args.cpp | 12 +- example/bind/example1.cpp | 12 +- .../callable_traits/add_const_qualifier.hpp | 1 + include/callable_traits/add_cv_qualifiers.hpp | 1 + .../callable_traits/add_lvalue_qualifier.hpp | 1 + .../callable_traits/add_rvalue_qualifier.hpp | 1 + include/callable_traits/add_varargs.hpp | 1 + .../add_volatile_qualifier.hpp | 1 + .../callable_traits/apply_member_pointer.hpp | 1 + include/callable_traits/apply_return.hpp | 1 + include/callable_traits/arg_at.hpp | 1 + include/callable_traits/args.hpp | 5 +- include/callable_traits/arity.hpp | 1 + include/callable_traits/bind.hpp | 1 + include/callable_traits/callable_traits.hpp | 1 + include/callable_traits/can_invoke.hpp | 1 + .../callable_traits/can_invoke_constexpr.hpp | 1 + .../detail/required_definitions.hpp | 19 + include/callable_traits/function_type.hpp | 1 + include/callable_traits/has_varargs.hpp | 2 +- include/callable_traits/has_void_return.hpp | 1 + .../callable_traits/is_const_qualified.hpp | 1 + include/callable_traits/is_constexpr.hpp | 1 + include/callable_traits/is_cv_qualified.hpp | 1 + .../callable_traits/is_lvalue_qualified.hpp | 1 + .../is_reference_qualified.hpp | 1 + .../callable_traits/is_rvalue_qualified.hpp | 1 + include/callable_traits/is_unqualified.hpp | 1 + .../callable_traits/is_volatile_qualified.hpp | 1 + include/callable_traits/max_arity.hpp | 1 + include/callable_traits/min_arity.hpp | 1 + .../no_sfinae/add_const_qualifier.hpp | 1 + .../no_sfinae/add_cv_qualifiers.hpp | 1 + .../no_sfinae/add_lvalue_qualifier.hpp | 5 +- .../no_sfinae/add_rvalue_qualifier.hpp | 1 + .../callable_traits/no_sfinae/add_varargs.hpp | 1 + .../no_sfinae/add_volatile_qualifier.hpp | 1 + .../no_sfinae/apply_member_pointer.hpp | 1 + .../no_sfinae/apply_return.hpp | 1 + include/callable_traits/no_sfinae/arg_at.hpp | 1 + include/callable_traits/no_sfinae/args.hpp | 1 + .../no_sfinae/function_type.hpp | 1 + .../no_sfinae/qualified_function_type.hpp | 5 +- .../no_sfinae/remove_const_qualifier.hpp | 1 + .../no_sfinae/remove_cv_qualifiers.hpp | 5 +- .../no_sfinae/remove_member_pointer.hpp | 1 + .../no_sfinae/remove_reference_qualifier.hpp | 1 + .../no_sfinae/remove_varargs.hpp | 1 + .../no_sfinae/remove_volatile_qualifier.hpp | 5 +- .../callable_traits/no_sfinae/result_of.hpp | 4 +- .../qualified_function_type.hpp | 1 + .../remove_const_qualifier.hpp | 1 + .../callable_traits/remove_cv_qualifiers.hpp | 1 + .../callable_traits/remove_member_pointer.hpp | 1 + .../remove_reference_qualifier.hpp | 1 + include/callable_traits/remove_varargs.hpp | 1 + .../remove_volatile_qualifier.hpp | 1 + include/callable_traits/result_of.hpp | 1 + 60 files changed, 444 insertions(+), 57 deletions(-) create mode 100644 include/callable_traits/detail/required_definitions.hpp diff --git a/doc/callable_traits.qbk b/doc/callable_traits.qbk index 1539036..62e518d 100644 --- a/doc/callable_traits.qbk +++ b/doc/callable_traits.qbk @@ -1,20 +1,139 @@ [library CallableTraits - [authors [Adair, Barrett]] - [copyright 2016 Barrett Adair] - [license - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or copy at - - http://www.boost.org/LICENSE_1_0.txt - ) - ] + [quickbook 1.6] [id callable_traits] - [last-revision $Date$] + [copyright 2016 Barrett Adair] + [authors [Adair, Barrett]] + [license + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE.md or copy at + [@http://www.boost.org/LICENSE_1_0.txt http://www.boost.org/LICENSE_1_0.txt]) + ] + [source-mode c++] + [last-revision $Date$] + [lang en] ] -[section:moti Motivation] +[section:introduction Introduction] -[c++] +[section:basic_example Basic Example] + + #include + #include + #include + #include + + struct foo { + void operator()(int, int&&, const int&, void* = nullptr) const {} + }; + + namespace ct = callable_traits; + using namespace std::placeholders; + + int main() { + + // indexed argument types + using second_arg = ct::arg_at<1, foo>; + static_assert(std::is_same::value, ""); + + // arg types are packaged into std::tuple, which serves as the default + // type list in CallableTraits (runtime capabilities are not used). + using args = ct::args; + using expected_args = std::tuple; + static_assert(std::is_same::value, ""); + + //callable_traits::result_of is a bit friendlier than std::result_of + using return_type = ct::result_of; + static_assert(std::is_same::value, ""); + + //has_void_return is a quicker way to perform the check above + static_assert(ct::has_void_return(foo{}), ""); + + // callable_traits::function_type decays a callable type to + // a plain function type, which is structured in terms of INVOKE + using function_type = ct::function_type; + using expected_function_type = void(int, int&&, const int&, void*); + static_assert(std::is_same::value, ""); + + // when trait information can be conveyed in an std::integral_constant, + // callable_traits opts for constexpr functions instead of template aliases. + // This is done to encourage value semantics, and to simplify usage inside + // of forwarding functions. + static_assert(ct::arity(foo{}) == 4, ""); + static_assert(ct::max_arity(foo{}) == 4, ""); + static_assert(ct::min_arity(foo{}) == 3, ""); + + // CallableTraits provides constexpr functions so that the user doesn't + // need to worry about reference collapsing or decltype when dealing with + // universal references to callables. Still, you don't NEED an instance, + // because CallableTraits provides non-deduced function templates for + // all constexpr functions (except for can_invoke/can_invoke_constexpr and bind, + // which model std::invoke and std::bind, respectively -- more on these below). + // Here's an example of the non-deduced version of arity, which take an + // explicit type argument. We'll ignore these non-deduced overloads for the + // rest of this example. + static_assert(ct::arity() == 4, ""); + + // C-style variadics detection (ellipses in a signature) + static_assert(!ct::has_varargs(foo{}), ""); + + int i = 0; + + // callable_traits::can_invoke allows us to preview whether std::invoke will + // compile with the given arguments. + static_assert(ct::can_invoke(foo{}, 0, 0, i), ""); + // no error: std::invoke(foo{}, 0, 0, i); + + static_assert(!ct::can_invoke(foo{}, nullptr), ""); + // error: std::invoke(foo{}, nullptr); + + // For function objects, the following checks are determined by the + // qualifiers on operator(), rather than the category of the passed value. + // For member function pointers and abominable function types, the + // qualifiers on the function type are used. + static_assert(ct::is_const_qualified(foo{}), ""); + static_assert(!ct::is_volatile_qualified(foo{}), ""); + static_assert(!ct::is_reference_qualified(foo{}), ""); + static_assert(!ct::is_lvalue_qualified(foo{}), ""); + static_assert(!ct::is_rvalue_qualified(foo{}), ""); + + + // If you find yourself in the unfortunate situation of needing + // to manipulate member function pointer types, CallableTraits + // has all the tools you need to maintain your sanity. + + + using pmf = decltype(&foo::operator()); + + // So that you don't have to scroll back up to see, here's the type of pmf: + using with_const = void (foo::*)(int, int&&, const int&, void*) const; + static_assert(std::is_same::value, ""); + + // Let's remove the const qualifier: + using mutable_pmf = ct::remove_const_qualifier; + using without_const = void (foo::*)(int, int&&, const int&, void*) /*no const!*/; + static_assert(std::is_same::value, ""); + + // Now let's add an rvalue qualifier (&&): + using rvalue_pmf = ct::add_rvalue_qualifier; + using with_rvalue = void (foo::*)(int, int&&, const int&, void*) const &&; + static_assert(std::is_same::value, ""); + + // You get the picture. CallableTraits lets you add and remove all PMF + // qualifiers (const, volatile, &, &&, and any combination thereof). + // These type operations can generally be performed on abominable function + // types as well. + + // is_constexpr would return std::true_type if foo's operator() were constexpr. + static_assert(!ct::is_constexpr(foo{}), ""); + + // to check constexprness of a function or member function, you must use an + // std::integral_constant, like this: + using pmf_constant = std::integral_constant; + static_assert(!ct::is_constexpr(pmf_constant{}), ""); + } + +[endsect] +[section:motivation Motivation] The complexity of callable types in C++ is extensive: @@ -23,7 +142,7 @@ The complexity of callable types in C++ is extensive: *function references *objects with `operator()` *objects with function pointer conversions -*[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0172r0.html "abominable" function types] +*[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0172r0.html "abominable"] function types *pointers to member data *pointers to member functions *qualified overloads of member functions: `const`, `volatile`, `&`, `&&` @@ -31,7 +150,7 @@ The complexity of callable types in C++ is extensive: *calling conventions (`__cdecl`, `__stdcall`, `__fastcall`, `pascal`, etc.) *`noexcept` ([@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html part of the function type system in C++17]) -CallableTraits provides a comprehensive, uniform, and modern type-level interface for the manipulation and inspection of callable types in C++. By filling the gaps where existing library solutions fall short, CallableTraits aims to provide such an exhaustive interface for the features listed above that libary writers will *never again* need to specialize templates for callable types. With CallableTraits, library writers should never need to write a template like this one: +CallableTraits provides a comprehensive, uniform, and modern type-level interface for the manipulation and inspection of callable types in C++. By filling the gaps where existing library solutions fall short, CallableTraits aims to provide such an exhaustive interface for the features listed above that library writers will *never again* need to specialize templates for callable types. CallableTraits eliminates the need for horrific template specializations like these: template struct foo{ @@ -42,12 +161,16 @@ Several library solutions exist to manipulate these types, or to abstract away t The use cases for CallableTraits are closely related to those of [@http://www.boost.org/doc/libs/1_60_0/libs/type_traits/doc/html/boost_typetraits/reference/function_traits.html function_traits] and [@http://www.boost.org/doc/libs/1_60_0/libs/function_types/doc/html/index.html FunctionTypes]. -[section:tenr 10 reasons to use CallableTraits] +[important CallableTraits currently offers no interface for the manipulation of calling conventions. Also, no features are currently implemented to account for C++17's `noexcept`. These features are planned for future versions on supported platforms.] + +[endsect] + +[section:ten_reasons 10 reasons to use CallableTraits] # CallableTraits' template aliases and `constexpr` `std::integral_constant` functions are preferable to `typename foo::type` and `foo::value` # CallableTraits offers a familar, consistent interface for the synthesis and decomposition of callable types - * e.g. `callable_traits::remove_const_qualifier` parallels `std::remove_const` + * e.g. `remove_const_qualifier` parallels `std::remove_const` # universal references are accepted everywhere, so you don't need to worry about using `std::remove_reference` first @@ -68,14 +191,14 @@ The use cases for CallableTraits are closely related to those of [@http://www.bo [endsect] -[section:sugr Use case example: `std::function` sugar] +[section:function_sugar Use case: `std::function` sugar] At the time of this writing, there are 260 [@http://stackoverflow.com/search?q=convert+std%3A%3Abind+to+std%3A%3Afunction search results] on Stack Overflow concerning the conversion from `std::bind` to `std::function`. There are 336 [@http://stackoverflow.com/search?q=convert+lambda+to+std%3A%3Afunction search results] concerning the conversion of lambdas to `std::function`. With this example, we'll kill both birds with the same stone. The `make_function` function defined below will leverage CallableTraits to... # Create an `std::function` where T is not explicitly supplied by the user # Create an `std::function` where T is the deduced "signature" of an `std::placeholders` expression. -Without real-world context, `make_function` may seem rather silly to those who are aware of the runtime costs of type erasure. However, whenever `std::function` is required by some 3rd party API, this example makes a bit more sense. +Without real-world context, `make_function` may seem rather silly to those who know the runtime costs of type erasure. However, whenever `std::function` is required by some 3rd party API, this example might make a bit more sense. #include #include @@ -169,7 +292,7 @@ Without real-world context, `make_function` may seem rather silly to those who a [endsect] -[section:tuto Overview] +[section:reference Reference] CallableTraits contains the following type traits and metafunctions (psuedo-code): @@ -230,7 +353,7 @@ CallableTraits contains the following type traits and metafunctions (psuedo-code * `bind(T&&, Args&&...)` -Note: CallableTraits currently offers no interface for the manipulation of calling conventions. Also, no features are currently implemented to account for C++17's `noexcept`, but will be added in future versions for supported compilers. +[section:headers Headers] The simplest way to use CallableTraits is to include the main header file: @@ -274,3 +397,210 @@ CallableTraits interface is also broken down by trait into individual header fil #include [endsect] + +[section add_const_qualifier] +TODO +[endsect] + +[section add_cv_qualifiers] +TODO +[endsect] + +[section add_lvalue_qualifier] +TODO +[endsect] + +[section add_rvalue_qualifier] +TODO +[endsect] + +[section add_varargs] +TODO +[endsect] + +[section add_volatile_qualifier] +TODO +[endsect] + +[section apply_member_pointer] +[heading Example] +[import ../example/apply_member_pointer/example.cpp] +[apply_member_pointer_example] +[endsect] + +[section apply_return] +TODO +[endsect] + +[section arg_at] +TODO +[endsect] + +[section args] +[heading Example] +[import ../example/args/args.cpp] +[args_args] +[endsect] + +[section arity] +TODO +[endsect] + +[section bind] +[heading Example 1] +[import ../example/bind/example1.cpp] +[bind_example1] +TODO +[endsect] + +[section can_invoke] +TODO +[endsect] + +[section can_invoke_constexpr] +TODO +[endsect] + +[section function_type] +TODO +[endsect] + +[section has_varargs] +TODO +[endsect] + +[section has_void_return] +TODO +[endsect] + +[section is_const_qualified] +TODO +[endsect] + +[section is_constexpr] +TODO +[endsect] + +[section is_lvalue_qualified] +TODO +[endsect] + +[section is_reference_qualified] +TODO +[endsect] + +[section is_rvalue_qualified] +TODO +[endsect] + +[section is_unqualified] +TODO +[endsect] + +[section is_volatile_qualified] +TODO +[endsect] + +[section max_arity] +TODO +[endsect] + +[section min_arity] +TODO +[endsect] + +[section qualified_function_type] +TODO +[endsect] + +[section remove_const_qualifier] +TODO +[endsect] + +[section remove_cv_qualifiers] +TODO +[endsect] + +[section remove_member_pointer] +[heading Example] + + #include + + namespace ct = callable_traits; + + struct foo; + + template + void test() { + using U = ct::remove_member_pointer; + static_assert(std::is_same{}, ""); + } + + int main() { + + { + using T = int(foo::*)(int) const; + using expect = int(int) const; + test(); + } { + using T = int foo::*; + using expect = int; + test(); + } { + using T = int(int); + test(); + } { + using T = int(*)(int); + test(); + } { + using T = int(&)(int); + test(); + } + } + +[endsect] + +[section remove_reference_qualifier] +TODO +[endsect] + +[section remove_varargs] +TODO +[endsect] + +[section remove_volatile_qualifier] +TODO +[endsect] + +[section result_of] +[heading Example] + + #include + + namespace ct = callable_traits; + + using expect = int; + + struct foo; + + template + void test() { + using result = ct::result_of; + static_assert(std::is_same{}, ""); + } + + int main() { + + test(); + test(); + test(); + test(); + test(); + + auto x = []() -> int { return 0; }; + + test(); + } +[endsect] + +[endsect] diff --git a/example/apply_member_pointer/example.cpp b/example/apply_member_pointer/example.cpp index 111fa63..978a9f3 100644 --- a/example/apply_member_pointer/example.cpp +++ b/example/apply_member_pointer/example.cpp @@ -1,11 +1,13 @@ -/*! +/*<- Copyright (c) 2016 Barrett Adair Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) -*/ +->*/ -#include +//[ apply_member_pointer_example +#include +#include namespace ct = callable_traits; @@ -29,4 +31,5 @@ int main() { test(); test(); } +//] diff --git a/example/args/args.cpp b/example/args/args.cpp index b6d20fc..056204e 100644 --- a/example/args/args.cpp +++ b/example/args/args.cpp @@ -1,23 +1,24 @@ -/*! +/*<- Copyright (c) 2016 Barrett Adair Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) -*/ +->*/ +//[ args_args #include #include #include namespace ct = callable_traits; -//all callable types in this example use these parameter types +//` all callable types in this example use these parameter types using expect = std::tuple; template void test(){ - //this example shows how callable_traits::args - //bevaves consistently for many different types + /*` this example shows how callable_traits::args + bevaves consistently for many different types */ using args = ct::args; static_assert(std::is_same{}, ""); } @@ -55,4 +56,5 @@ int main() { using abominable = void(int, float&, const char*) const; test(); } +//] diff --git a/example/bind/example1.cpp b/example/bind/example1.cpp index 05159af..d58a676 100644 --- a/example/bind/example1.cpp +++ b/example/bind/example1.cpp @@ -1,11 +1,12 @@ -/* +/*<- Copyright Barrett Adair 2016 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) -*/ +->*/ +//[ bind_example1 #include #include #include @@ -57,9 +58,9 @@ int main() { _1 ); - // the last _1 placeholder in this bind expression forces - // all other _1 slots to accept ScaryMonster, the - // narrowest of all _1 parameters. + /*` the last _1 placeholder in this bind expression forces + all other _1 slots to accept ScaryMonster, the + narrowest of all _1 parameters. */ { using args = ct::args; @@ -75,3 +76,4 @@ int main() { return 0; } +//] diff --git a/include/callable_traits/add_const_qualifier.hpp b/include/callable_traits/add_const_qualifier.hpp index 94fcde3..4aa7e78 100644 --- a/include/callable_traits/add_const_qualifier.hpp +++ b/include/callable_traits/add_const_qualifier.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/add_cv_qualifiers.hpp b/include/callable_traits/add_cv_qualifiers.hpp index eca9aa6..a54d176 100644 --- a/include/callable_traits/add_cv_qualifiers.hpp +++ b/include/callable_traits/add_cv_qualifiers.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/add_lvalue_qualifier.hpp b/include/callable_traits/add_lvalue_qualifier.hpp index 81ac396..566b6ee 100644 --- a/include/callable_traits/add_lvalue_qualifier.hpp +++ b/include/callable_traits/add_lvalue_qualifier.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/add_rvalue_qualifier.hpp b/include/callable_traits/add_rvalue_qualifier.hpp index 0c65799..70c5096 100644 --- a/include/callable_traits/add_rvalue_qualifier.hpp +++ b/include/callable_traits/add_rvalue_qualifier.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/add_varargs.hpp b/include/callable_traits/add_varargs.hpp index 2e08425..f594cd0 100644 --- a/include/callable_traits/add_varargs.hpp +++ b/include/callable_traits/add_varargs.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/add_volatile_qualifier.hpp b/include/callable_traits/add_volatile_qualifier.hpp index a518643..04a306b 100644 --- a/include/callable_traits/add_volatile_qualifier.hpp +++ b/include/callable_traits/add_volatile_qualifier.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/apply_member_pointer.hpp b/include/callable_traits/apply_member_pointer.hpp index c22094f..f42b399 100644 --- a/include/callable_traits/apply_member_pointer.hpp +++ b/include/callable_traits/apply_member_pointer.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/apply_return.hpp b/include/callable_traits/apply_return.hpp index dc5b6ae..34f083e 100644 --- a/include/callable_traits/apply_return.hpp +++ b/include/callable_traits/apply_return.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/arg_at.hpp b/include/callable_traits/arg_at.hpp index 6218f91..cbcfaf1 100644 --- a/include/callable_traits/arg_at.hpp +++ b/include/callable_traits/arg_at.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_ARG_AT_HPP #include +#include #include namespace callable_traits { diff --git a/include/callable_traits/args.hpp b/include/callable_traits/args.hpp index 6e26bfb..2248599 100644 --- a/include/callable_traits/args.hpp +++ b/include/callable_traits/args.hpp @@ -13,10 +13,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include #include - -#include -#include -#include +#include namespace callable_traits { diff --git a/include/callable_traits/arity.hpp b/include/callable_traits/arity.hpp index 3c32e1b..4ad969b 100644 --- a/include/callable_traits/arity.hpp +++ b/include/callable_traits/arity.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/bind.hpp b/include/callable_traits/bind.hpp index 2423cba..b6d078e 100644 --- a/include/callable_traits/bind.hpp +++ b/include/callable_traits/bind.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include #include namespace callable_traits { diff --git a/include/callable_traits/callable_traits.hpp b/include/callable_traits/callable_traits.hpp index 52583f0..c9a91be 100644 --- a/include/callable_traits/callable_traits.hpp +++ b/include/callable_traits/callable_traits.hpp @@ -44,5 +44,6 @@ Distributed under the Boost Software License, Version 1.0. #include #include #include +#include #endif diff --git a/include/callable_traits/can_invoke.hpp b/include/callable_traits/can_invoke.hpp index cd1c111..697b477 100644 --- a/include/callable_traits/can_invoke.hpp +++ b/include/callable_traits/can_invoke.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_CAN_INVOKE_HPP #include +#include #include namespace callable_traits { diff --git a/include/callable_traits/can_invoke_constexpr.hpp b/include/callable_traits/can_invoke_constexpr.hpp index a373fe0..0768cb1 100644 --- a/include/callable_traits/can_invoke_constexpr.hpp +++ b/include/callable_traits/can_invoke_constexpr.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_CAN_INVOKE_CONSTEXPR_HPP #include +#include #include namespace callable_traits { diff --git a/include/callable_traits/detail/required_definitions.hpp b/include/callable_traits/detail/required_definitions.hpp new file mode 100644 index 0000000..277e5fb --- /dev/null +++ b/include/callable_traits/detail/required_definitions.hpp @@ -0,0 +1,19 @@ +/*! +@file + +@copyright Barrett Adair 2016 +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_DETAIL_REQUIRED_DEFINITIONS_HPP +#define CALLABLE_TRAITS_DETAIL_REQUIRED_DEFINITIONS_HPP + +#include +#include +#include +#include +#include + +#endif \ No newline at end of file diff --git a/include/callable_traits/function_type.hpp b/include/callable_traits/function_type.hpp index bb80f30..665241d 100644 --- a/include/callable_traits/function_type.hpp +++ b/include/callable_traits/function_type.hpp @@ -13,6 +13,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/has_varargs.hpp b/include/callable_traits/has_varargs.hpp index 56ce076..3d80040 100644 --- a/include/callable_traits/has_varargs.hpp +++ b/include/callable_traits/has_varargs.hpp @@ -11,7 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_HAS_VARARGS_HPP #include -#include +#include namespace callable_traits { diff --git a/include/callable_traits/has_void_return.hpp b/include/callable_traits/has_void_return.hpp index d89646f..04f39af 100644 --- a/include/callable_traits/has_void_return.hpp +++ b/include/callable_traits/has_void_return.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_HAS_VOID_RETURN_HPP #include +#include #include namespace callable_traits { diff --git a/include/callable_traits/is_const_qualified.hpp b/include/callable_traits/is_const_qualified.hpp index 8fff698..701159f 100644 --- a/include/callable_traits/is_const_qualified.hpp +++ b/include/callable_traits/is_const_qualified.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_IS_CONST_QUALIFIED_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/is_constexpr.hpp b/include/callable_traits/is_constexpr.hpp index 9827c40..d87e3e6 100644 --- a/include/callable_traits/is_constexpr.hpp +++ b/include/callable_traits/is_constexpr.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include #include namespace callable_traits { diff --git a/include/callable_traits/is_cv_qualified.hpp b/include/callable_traits/is_cv_qualified.hpp index 6e6587f..07f7a73 100644 --- a/include/callable_traits/is_cv_qualified.hpp +++ b/include/callable_traits/is_cv_qualified.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_IS_CV_QUALIFIED_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/is_lvalue_qualified.hpp b/include/callable_traits/is_lvalue_qualified.hpp index ec9e8f3..dfec674 100644 --- a/include/callable_traits/is_lvalue_qualified.hpp +++ b/include/callable_traits/is_lvalue_qualified.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_IS_LVALUE_QUALIFIED_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/is_reference_qualified.hpp b/include/callable_traits/is_reference_qualified.hpp index 71baffd..600a9c3 100644 --- a/include/callable_traits/is_reference_qualified.hpp +++ b/include/callable_traits/is_reference_qualified.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_IS_REFERENCE_QUALIFIED_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/is_rvalue_qualified.hpp b/include/callable_traits/is_rvalue_qualified.hpp index 2fe401b..745dfcb 100644 --- a/include/callable_traits/is_rvalue_qualified.hpp +++ b/include/callable_traits/is_rvalue_qualified.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_IS_RVALUE_QUALIFIED_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/is_unqualified.hpp b/include/callable_traits/is_unqualified.hpp index eb0d121..5efade7 100644 --- a/include/callable_traits/is_unqualified.hpp +++ b/include/callable_traits/is_unqualified.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_IS_UNQUALIFIED_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/is_volatile_qualified.hpp b/include/callable_traits/is_volatile_qualified.hpp index 94fc67a..bee833a 100644 --- a/include/callable_traits/is_volatile_qualified.hpp +++ b/include/callable_traits/is_volatile_qualified.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_IS_VOLATILE_QUALIFIED_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/max_arity.hpp b/include/callable_traits/max_arity.hpp index 90f5b97..88bd476 100644 --- a/include/callable_traits/max_arity.hpp +++ b/include/callable_traits/max_arity.hpp @@ -13,6 +13,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include #include +#include #include namespace callable_traits { diff --git a/include/callable_traits/min_arity.hpp b/include/callable_traits/min_arity.hpp index f5d3de8..ccc172c 100644 --- a/include/callable_traits/min_arity.hpp +++ b/include/callable_traits/min_arity.hpp @@ -13,6 +13,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include #include +#include #include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/add_const_qualifier.hpp b/include/callable_traits/no_sfinae/add_const_qualifier.hpp index 75effc2..b8373c3 100644 --- a/include/callable_traits/no_sfinae/add_const_qualifier.hpp +++ b/include/callable_traits/no_sfinae/add_const_qualifier.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_ADD_CONST_QUALIFIER_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/add_cv_qualifiers.hpp b/include/callable_traits/no_sfinae/add_cv_qualifiers.hpp index e7a63ff..78bb9ba 100644 --- a/include/callable_traits/no_sfinae/add_cv_qualifiers.hpp +++ b/include/callable_traits/no_sfinae/add_cv_qualifiers.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_ADD_CV_QUALIFIERS_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/add_lvalue_qualifier.hpp b/include/callable_traits/no_sfinae/add_lvalue_qualifier.hpp index ec44509..01941b8 100644 --- a/include/callable_traits/no_sfinae/add_lvalue_qualifier.hpp +++ b/include/callable_traits/no_sfinae/add_lvalue_qualifier.hpp @@ -11,10 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_ADD_LVALUE_QUALIFIER_HPP #include - -#include -#include -#include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/add_rvalue_qualifier.hpp b/include/callable_traits/no_sfinae/add_rvalue_qualifier.hpp index ba95c2f..f896bb1 100644 --- a/include/callable_traits/no_sfinae/add_rvalue_qualifier.hpp +++ b/include/callable_traits/no_sfinae/add_rvalue_qualifier.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_ADD_RVALUE_QUALIFIER_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/add_varargs.hpp b/include/callable_traits/no_sfinae/add_varargs.hpp index a1e4c7a..db46282 100644 --- a/include/callable_traits/no_sfinae/add_varargs.hpp +++ b/include/callable_traits/no_sfinae/add_varargs.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_ADD_VARARGS_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/add_volatile_qualifier.hpp b/include/callable_traits/no_sfinae/add_volatile_qualifier.hpp index e310cfb..8e8a2b5 100644 --- a/include/callable_traits/no_sfinae/add_volatile_qualifier.hpp +++ b/include/callable_traits/no_sfinae/add_volatile_qualifier.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_ADD_VOLATILE_QUALIFIER_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/apply_member_pointer.hpp b/include/callable_traits/no_sfinae/apply_member_pointer.hpp index a2ee8c9..efe66bb 100644 --- a/include/callable_traits/no_sfinae/apply_member_pointer.hpp +++ b/include/callable_traits/no_sfinae/apply_member_pointer.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_APPLY_MEMBER_POINTER_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/apply_return.hpp b/include/callable_traits/no_sfinae/apply_return.hpp index 3cf1f70..6b7c3ef 100644 --- a/include/callable_traits/no_sfinae/apply_return.hpp +++ b/include/callable_traits/no_sfinae/apply_return.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_APPLY_RETURN_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/arg_at.hpp b/include/callable_traits/no_sfinae/arg_at.hpp index fd29370..ca90f7d 100644 --- a/include/callable_traits/no_sfinae/arg_at.hpp +++ b/include/callable_traits/no_sfinae/arg_at.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/args.hpp b/include/callable_traits/no_sfinae/args.hpp index f982823..1469983 100644 --- a/include/callable_traits/no_sfinae/args.hpp +++ b/include/callable_traits/no_sfinae/args.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_ARGS_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/function_type.hpp b/include/callable_traits/no_sfinae/function_type.hpp index 4940e1c..1a658a2 100644 --- a/include/callable_traits/no_sfinae/function_type.hpp +++ b/include/callable_traits/no_sfinae/function_type.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_FUNCTION_TYPE_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/qualified_function_type.hpp b/include/callable_traits/no_sfinae/qualified_function_type.hpp index f965d9c..4acb26c 100644 --- a/include/callable_traits/no_sfinae/qualified_function_type.hpp +++ b/include/callable_traits/no_sfinae/qualified_function_type.hpp @@ -11,10 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_QUALIFIED_FUNCTION_TYPE_HPP #include - -#include -#include -#include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/remove_const_qualifier.hpp b/include/callable_traits/no_sfinae/remove_const_qualifier.hpp index a9c7cc3..68e7327 100644 --- a/include/callable_traits/no_sfinae/remove_const_qualifier.hpp +++ b/include/callable_traits/no_sfinae/remove_const_qualifier.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_REMOVE_CONST_QUALIFIER_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/remove_cv_qualifiers.hpp b/include/callable_traits/no_sfinae/remove_cv_qualifiers.hpp index 618672b..5645b5f 100644 --- a/include/callable_traits/no_sfinae/remove_cv_qualifiers.hpp +++ b/include/callable_traits/no_sfinae/remove_cv_qualifiers.hpp @@ -11,10 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_REMOVE_CV_QUALIFIERS_HPP #include - -#include -#include -#include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/remove_member_pointer.hpp b/include/callable_traits/no_sfinae/remove_member_pointer.hpp index 1e421ef..1f4e00a 100644 --- a/include/callable_traits/no_sfinae/remove_member_pointer.hpp +++ b/include/callable_traits/no_sfinae/remove_member_pointer.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_REMOVE_MEMBER_POINTER_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/remove_reference_qualifier.hpp b/include/callable_traits/no_sfinae/remove_reference_qualifier.hpp index a5035c9..470a71c 100644 --- a/include/callable_traits/no_sfinae/remove_reference_qualifier.hpp +++ b/include/callable_traits/no_sfinae/remove_reference_qualifier.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_REMOVE_REFERENCE_QUALIFIER_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/remove_varargs.hpp b/include/callable_traits/no_sfinae/remove_varargs.hpp index 4fcd760..4afc3ac 100644 --- a/include/callable_traits/no_sfinae/remove_varargs.hpp +++ b/include/callable_traits/no_sfinae/remove_varargs.hpp @@ -11,6 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_REMOVE_VARARGS_HPP #include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/remove_volatile_qualifier.hpp b/include/callable_traits/no_sfinae/remove_volatile_qualifier.hpp index c2b4bb5..e2dcd9d 100644 --- a/include/callable_traits/no_sfinae/remove_volatile_qualifier.hpp +++ b/include/callable_traits/no_sfinae/remove_volatile_qualifier.hpp @@ -11,10 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_REMOVE_VOLATILE_QUALIFIER_HPP #include - -#include -#include -#include +#include namespace callable_traits { diff --git a/include/callable_traits/no_sfinae/result_of.hpp b/include/callable_traits/no_sfinae/result_of.hpp index 3560caf..8db1e61 100644 --- a/include/callable_traits/no_sfinae/result_of.hpp +++ b/include/callable_traits/no_sfinae/result_of.hpp @@ -11,9 +11,7 @@ Distributed under the Boost Software License, Version 1.0. #define CALLABLE_TRAITS_NO_SFINAE_RESULT_OF_HPP #include -#include -#include -#include +#include namespace callable_traits { diff --git a/include/callable_traits/qualified_function_type.hpp b/include/callable_traits/qualified_function_type.hpp index ecac270..40f0c4a 100644 --- a/include/callable_traits/qualified_function_type.hpp +++ b/include/callable_traits/qualified_function_type.hpp @@ -13,6 +13,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/remove_const_qualifier.hpp b/include/callable_traits/remove_const_qualifier.hpp index 25fb9b9..3053c21 100644 --- a/include/callable_traits/remove_const_qualifier.hpp +++ b/include/callable_traits/remove_const_qualifier.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/remove_cv_qualifiers.hpp b/include/callable_traits/remove_cv_qualifiers.hpp index 26635e0..8809098 100644 --- a/include/callable_traits/remove_cv_qualifiers.hpp +++ b/include/callable_traits/remove_cv_qualifiers.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/remove_member_pointer.hpp b/include/callable_traits/remove_member_pointer.hpp index 1798f19..7e26527 100644 --- a/include/callable_traits/remove_member_pointer.hpp +++ b/include/callable_traits/remove_member_pointer.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/remove_reference_qualifier.hpp b/include/callable_traits/remove_reference_qualifier.hpp index dda2d33..113e59c 100644 --- a/include/callable_traits/remove_reference_qualifier.hpp +++ b/include/callable_traits/remove_reference_qualifier.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/remove_varargs.hpp b/include/callable_traits/remove_varargs.hpp index d9a3a9a..2163884 100644 --- a/include/callable_traits/remove_varargs.hpp +++ b/include/callable_traits/remove_varargs.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/remove_volatile_qualifier.hpp b/include/callable_traits/remove_volatile_qualifier.hpp index d633c86..9f509cb 100644 --- a/include/callable_traits/remove_volatile_qualifier.hpp +++ b/include/callable_traits/remove_volatile_qualifier.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { diff --git a/include/callable_traits/result_of.hpp b/include/callable_traits/result_of.hpp index 6e89d9d..6ef41fa 100644 --- a/include/callable_traits/result_of.hpp +++ b/include/callable_traits/result_of.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits {