|
||||
File indexing completed on 2025-01-18 09:53:38
0001 0002 // (C) Copyright Edward Diener 2011-2015 0003 // Use, modification and distribution are subject to the Boost Software License, 0004 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 0005 // http://www.boost.org/LICENSE_1_0.txt). 0006 0007 #if !defined(BOOST_VMD_IDENTITY_HPP) 0008 #define BOOST_VMD_IDENTITY_HPP 0009 0010 #include <boost/vmd/detail/setup.hpp> 0011 0012 #if BOOST_PP_VARIADICS 0013 0014 #if BOOST_VMD_MSVC 0015 #include <boost/preprocessor/cat.hpp> 0016 #endif 0017 #include <boost/vmd/empty.hpp> 0018 0019 /* 0020 0021 The succeeding comments in this file are in doxygen format. 0022 0023 */ 0024 0025 /** \file 0026 */ 0027 0028 /** \def BOOST_VMD_IDENTITY(item) 0029 0030 \brief Macro which expands to its argument when invoked with any number of parameters. 0031 0032 item = any single argument 0033 0034 When BOOST_VMD_IDENTITY(item) is subsequently invoked with any number of parameters it expands 0035 to 'item'. Subsequently invoking the macro is done as 'BOOST_VMD_IDENTITY(item)(zero_or_more_arguments)'. 0036 0037 The macro is equivalent to the Boost PP macro BOOST_PP_IDENTITY(item) with the difference 0038 being that BOOST_PP_IDENTITY(item) is always invoked with no arguments, as in 0039 'BOOST_VMD_IDENTITY(item)()' whereas BOOST_VMD_IDENTITY can be invoked with any number of 0040 arguments. 0041 0042 The macro is meant to be used in BOOST_PP_IF and BOOST_PP_IIF statements when only one 0043 of the clauses needs to be invoked with calling another macro and the other is meant to 0044 return an 'item'. 0045 0046 returns = the macro as 'BOOST_VMD_IDENTITY(item)', when invoked with any number of parameters 0047 as in '(zero_or_more_arguments)', returns 'item'. The macro itself returns 0048 'item BOOST_VMD_EMPTY'. 0049 0050 */ 0051 0052 #define BOOST_VMD_IDENTITY(item) item BOOST_VMD_EMPTY 0053 0054 /** \def BOOST_VMD_IDENTITY_RESULT(result) 0055 0056 \brief Macro which wraps any result which can return its value using BOOST_VMD_IDENTITY or 'item BOOST_VMD_EMPTY'. 0057 0058 result = any single result returned when BOOST_VMD_IDENTITY is used or 'item BOOST_VMD_EMPTY'. 0059 0060 The reason for this macro is to smooth over a problem when using VC++ with BOOST_VMD_IDENTITY. 0061 If your BOOST_VMD_IDENTITY macro can be used where VC++ is the compiler then you need to 0062 surround your macro code which could return a result with this macro in order that VC++ handles 0063 BOOST_VMD_IDENTITY correctly. 0064 0065 If you are not using VC++ you do not have to use this macro, but doing so does no harm. 0066 0067 */ 0068 0069 #if BOOST_VMD_MSVC 0070 #define BOOST_VMD_IDENTITY_RESULT(result) BOOST_PP_CAT(result,) 0071 #else 0072 #define BOOST_VMD_IDENTITY_RESULT(result) result 0073 #endif 0074 0075 #endif /* BOOST_PP_VARIADICS */ 0076 #endif /* BOOST_VMD_IDENTITY_HPP */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |