Reputation:
What does this line do? I doubt its a template or expression. (doing those divies and naming a member hpp 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
Upvotes: 3
Views: 583
Reputation: 385098
Apparently it does some auto-incrementing magic.
Here's the documentation.
I have no idea how it works. What I do know is that the magic is in counter.hpp itself; that the definition you posted has brackets in it is just so that you can write the vaguely user-friendly:
#include BOOST_PP_UPDATE_COUNTER()
to invoke said magic.
Upvotes: 6
Reputation: 206679
It's just a "shortcut" so you can do
#include BOOST_PP_UPDATE_COUNTER()
in your code rather than know the details of how that feature is implemented.
See this question Incremented define's answers for some usage example.
Upvotes: 2