|
||||
File indexing completed on 2025-01-18 09:53:30
0001 0002 // Copyright (C) 2009-2012 Lorenzo Caminiti 0003 // Distributed under the Boost Software License, Version 1.0 0004 // (see accompanying file LICENSE_1_0.txt or a copy at 0005 // http://www.boost.org/LICENSE_1_0.txt) 0006 // Home at http://www.boost.org/libs/utility/identity_type 0007 0008 /** @file 0009 Wrap type expressions with round parenthesis so they can be passed to macros 0010 even if they contain commas. 0011 */ 0012 0013 #ifndef BOOST_IDENTITY_TYPE_HPP_ 0014 #define BOOST_IDENTITY_TYPE_HPP_ 0015 0016 #include <boost/type_traits/function_traits.hpp> 0017 0018 /** 0019 @brief This macro allows to wrap the specified type expression within extra 0020 round parenthesis so the type can be passed as a single macro parameter even if 0021 it contains commas (not already wrapped within round parenthesis). 0022 0023 @Params 0024 @Param{parenthesized_type, 0025 The type expression to be passed as macro parameter wrapped by a single set 0026 of round parenthesis <c>(...)</c>. 0027 This type expression can contain an arbitrary number of commas. 0028 } 0029 @EndParams 0030 0031 This macro works on any C++03 compiler (it does not use variadic macros). 0032 0033 This macro must be prefixed by <c>typename</c> when used within templates. 0034 Note that the compiler will not be able to automatically determine function 0035 template parameters when they are wrapped with this macro (these parameters 0036 need to be explicitly specified when calling the function template). 0037 0038 On some compilers (like GCC), using this macro on abstract types requires to 0039 add and remove a reference to the specified type. 0040 */ 0041 #define BOOST_IDENTITY_TYPE(parenthesized_type) \ 0042 /* must NOT prefix this with `::` to work with parenthesized syntax */ \ 0043 boost::function_traits< void parenthesized_type >::arg1_type 0044 0045 #endif // #include guard 0046
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |