1 2 // (C) Copyright Edward Diener 2015 3 // Use, modification and distribution are subject to the Boost Software License, 4 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt). 6 7 #if !defined(BOOST_VMD_SEQ_TO_LIST_HPP) 8 #define BOOST_VMD_SEQ_TO_LIST_HPP 9 10 #include <boost/vmd/detail/setup.hpp> 11 12 #if BOOST_PP_VARIADICS 13 14 #include <boost/preprocessor/control/iif.hpp> 15 #include <boost/preprocessor/seq/to_list.hpp> 16 // #include <boost/vmd/identity.hpp> 17 #include <boost/vmd/is_empty.hpp> 18 19 /* 20 21 The succeeding comments in this file are in doxygen format. 22 23 */ 24 25 /** \file 26 */ 27 28 /** \def BOOST_VMD_SEQ_TO_LIST(seq) 29 30 \brief converts a seq to a list. 31 32 seq = seq to be converted. 33 34 If the seq is an empty seq it is converted to an empty list (BOOST_PP_NIL). 35 Otherwise the seq is converted to a list with the same number of elements as the seq. 36 */ 37 38 #if BOOST_VMD_MSVC 39 #define BOOST_VMD_SEQ_TO_LIST(seq) \ 40 BOOST_PP_IIF \ 41 ( \ 42 BOOST_VMD_IS_EMPTY(seq), \ 43 BOOST_VMD_SEQ_TO_LIST_PE, \ 44 BOOST_VMD_SEQ_TO_LIST_NPE \ 45 ) \ 46 (seq) \ 47 /**/ 48 #define BOOST_VMD_SEQ_TO_LIST_PE(seq) BOOST_PP_NIL 49 /**/ 50 #define BOOST_VMD_SEQ_TO_LIST_NPE(seq) BOOST_PP_SEQ_TO_LIST(seq) 51 /**/ 52 #else 53 #define BOOST_VMD_SEQ_TO_LIST(seq) \ 54 BOOST_PP_IIF \ 55 ( \ 56 BOOST_VMD_IS_EMPTY(seq), \ 57 BOOST_VMD_IDENTITY(BOOST_PP_NIL), \ 58 BOOST_PP_SEQ_TO_LIST \ 59 ) \ 60 (seq) \ 61 /**/ 62 #endif 63 64 #endif /* BOOST_PP_VARIADICS */ 65 #endif /* BOOST_VMD_SEQ_TO_LIST_HPP */ 66