Files
boost_preprocessor/include/boost/preprocessor/enum_shifted.hpp

43 lines
1.2 KiB
C++
Raw Normal View History

#ifndef BOOST_PREPROCESSOR_ENUM_SHIFTED_HPP
#define BOOST_PREPROCESSOR_ENUM_SHIFTED_HPP
/* Copyright (C) 2001
* Housemarque Oy
* http://www.housemarque.com
*
* Permission to copy, use, modify, sell and distribute this software is
* granted provided this copyright notice appears in all copies. This
* software is provided "as is" without express or implied warranty, and
* with no claim as to its suitability for any purpose.
*
* See http://www.boost.org for most recent version.
*/
#include <boost/preprocessor/enum.hpp>
#include <boost/preprocessor/dec.hpp>
#include <boost/preprocessor/inc.hpp>
2002-01-31 14:21:31 +00:00
/** <P>Generates a comma separated shifted list.</P>
2002-01-31 14:21:31 +00:00
<P>In other words, expands to the sequence:</P>
2002-01-31 14:21:31 +00:00
<PRE>
F(1,P), F(2,P), ..., F(N-1,P)
2002-01-31 14:21:31 +00:00
</PRE>
2002-01-30 19:52:31 +00:00
<H3>Uses</H3>
2002-01-31 14:21:31 +00:00
<UL>
<LI>BOOST_PP_REPEAT()
</UL>
*/
#define BOOST_PP_ENUM_SHIFTED(N,F,P) BOOST_PP_ENUM(BOOST_PP_DEC(N),BOOST_PP_ENUM_SHIFTED_F,(F,P))
#ifndef DOXYGEN_SHOULD_SKIP_THIS
2002-01-25 13:15:56 +00:00
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
# define BOOST_PP_ENUM_SHIFTED_F(I,FP) BOOST_PP_TUPLE_ELEM(2,0,FP)(BOOST_PP_INC(I),BOOST_PP_TUPLE_ELEM(2,1,FP))
#else
# define BOOST_PP_ENUM_SHIFTED_F(I,FP) BOOST_PP_TUPLE2_ELEM0 FP(BOOST_PP_INC(I),BOOST_PP_TUPLE2_ELEM1 FP)
#endif
#endif
#endif