Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:34:24

0001 /*
0002 
0003 @Copyright Barrett Adair 2015-2017
0004 Distributed under the Boost Software License, Version 1.0.
0005 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
0006 
0007 */
0008 
0009 #ifndef BOOST_CLBL_TRTS_ADD_VARARGS_HPP
0010 #define BOOST_CLBL_TRTS_ADD_VARARGS_HPP
0011 
0012 #include <boost/callable_traits/detail/core.hpp>
0013 
0014 namespace boost { namespace callable_traits {
0015 
0016 //[ add_varargs_hpp
0017 /*`
0018 [section:ref_add_varargs add_varargs]
0019 [heading Header]
0020 ``#include <boost/callable_traits/add_varargs.hpp>``
0021 [heading Definition]
0022 */
0023 
0024 template<typename T>
0025 using add_varargs_t = //see below
0026 //<-
0027     detail::try_but_fail_if_invalid<
0028         typename detail::traits<T>::add_varargs,
0029         varargs_are_illegal_for_this_type>;
0030 
0031 namespace detail {
0032 
0033     template<typename T, typename = std::false_type>
0034     struct add_varargs_impl {};
0035 
0036     template<typename T>
0037     struct add_varargs_impl <T, typename std::is_same<
0038         add_varargs_t<T>, detail::dummy>::type>
0039     {
0040         using type = add_varargs_t<T>;
0041     };
0042 }
0043 //->
0044 
0045 template<typename T>
0046 struct add_varargs : detail::add_varargs_impl<T> {};
0047 
0048 //<-
0049 }} // namespace boost::callable_traits
0050 //->
0051 
0052 /*`
0053 [heading Constraints]
0054 * `T` must be one of the following:
0055   * function type
0056   * function pointer type
0057   * function reference type
0058   * member function pointer type
0059 * If `T` is a pointer, it may not be cv/ref qualified
0060 
0061 [heading Behavior]
0062 * A substitution failure occurs if the constraints are violated.
0063 * Adds C-style variadics (`...`) to the signature of `T`, if not already present.
0064 
0065 [heading Input/Output Examples]
0066 [table
0067     [[`T`]                              [`add_varargs_t<T>`]]
0068     [[`int()`]                          [`int(...)`]]
0069     [[`int(int)`]                          [`int(int, ...)`]]
0070     [[`int (&)()`]                      [`int(&)(...)`]]
0071     [[`int (*)()`]                      [`int(*)(...)`]]
0072     [[`int (*)(...)`]                   [`int(*)(...)`]]
0073     [[`int(foo::*)()`]                  [`int(foo::*)(...)`]]
0074     [[`int(foo::*)() &`]                [`int(foo::*)(...) &`]]
0075     [[`int(foo::*)() &&`]               [`int(foo::*)(...) &&`]]
0076     [[`int(foo::*)() const`]            [`int(foo::*)(...) const`]]
0077     [[`int(foo::*)() transaction_safe`] [`int(foo::*)(...) transaction_safe`]]
0078     [[`int`]                            [(substitution failure)]]
0079     [[`int foo::*`]                     [(substitution failure)]]
0080     [[`int (*&)()`]                     [(substitution failure)]]
0081 ]
0082 
0083 [heading Example Program]
0084 [import ../example/add_varargs.cpp]
0085 [add_varargs]
0086 [endsect]
0087 */
0088 //]
0089 
0090 #endif