Boost logo

Boost :

Subject: Re: [boost] __COUNTER__ vs __LINE__
From: Kim Barrett (kab.conundrums_at_[hidden])
Date: 2012-01-13 18:25:53


On Jan 13, 2012, at 2:16 PM, lcaminiti wrote:
> OK. Is there a Boost macro like this already?
>
> #include <boost/config.hpp>
>
> #ifdef BOOST_MSVC
> # define BOOST_LINE_COUNTER __COUNTER__
> #else
> # define BOOST_LINE_COUNTER __LINE__
> #endif

__COUNTER__ is also available in gcc4.3 and later.

http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html#Common-Predefined-Macros

I don't know how precisely it matches the MSVC __COUNTER__ in various cases like pre-compiled headers and the like.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk