What does #define macro () <...> do?

What does this line do? I doubt this is a pattern or expression. (doing those divisions and calling a hpp member is a bad idea)

# define BOOST_PP_UPDATE_COUNTER() <boost/preprocessor/slot/detail/counter.hpp>

Full file

# /* **************************************************************************
#  *                                                                          *
#  *     (C) Copyright Paul Mensonides 2005.                                  *
#  *     Distributed under the Boost Software License, Version 1.0. (See      *
#  *     accompanying file LICENSE_1_0.txt or copy at                         *
#  *     http://www.boost.org/LICENSE_1_0.txt)                                *
#  *                                                                          *
#  ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_SLOT_COUNTER_HPP
# define BOOST_PREPROCESSOR_SLOT_COUNTER_HPP
#
# include <boost/preprocessor/slot/detail/def.hpp>
#
# /* BOOST_PP_COUNTER */
#
# define BOOST_PP_COUNTER 0
#
# /* BOOST_PP_UPDATE_COUNTER */
#
# define BOOST_PP_UPDATE_COUNTER() <boost/preprocessor/slot/detail/counter.hpp>
#
# endif
+3
source share
2 answers

Apparently, he is doing some auto-incremental magic.

Here is the documentation .

I have no idea how this works. I know that magic is in Counter.hpp itself; that the definition you specified contains brackets in it, so you can write vaguely convenient:

#include BOOST_PP_UPDATE_COUNTER()

to call the specified magic.

+6
source

It's just a shortcut, so you can do

#include BOOST_PP_UPDATE_COUNTER()

, .

. .

+2

All Articles