Back to home page

EIC code displayed by LXR

 
 

    


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

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