
Paul Mensonides wrote:
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Pavol Droba
Would it be possible to add BOOST_PP_RESET_COUNTER() macro. The effect is to reset BOOST_PP_COUNTER to zero.
The purpose of the counter is to provide a globally unique number--across includes and across libraries. If actually need a variable, you should use the slot mechanism instead. It is a little more wordy, but it gives you more control over what the value actually is.
#define BOOST_PP_VALUE 0 #include BOOST_PP_ASSIGN_SLOT(1)
BOOST_PP_SLOT(1) // 0
#define BOOST_PP_VALUE BOOST_PP_SLOT(1) + 1 #include BOOST_PP_ASSIGN_SLOT(1)
BOOST_PP_SLOT(1) // 1
// etc.
We could add a BOOST_PP_SLOT_INC macro to shorten this.
Thanks for explanation. This is sufficient for my needs, even though I find counter more elegant. BOOST_PP_SLOT_INC would be handy. Best regards, Pavol.