Boost logo

Boost :

From: Jim Apple (japple_at_[hidden])
Date: 2004-04-22 15:45:37


Arkadiy Vertleyb wrote:

> There are two problems I can see here. One is related to getting a unique
> integer (what I am using __COUNTER__ for). I am trying to figure out the
> portable way of doing this (Paul just showed me something I think can work).

See attached. Instead of __COUNTER__, it is used via GET and SET. SET
bumps the value by 1. It can also be used inside functions and
namespaces. The attached test.cpp outputs

0
2
4
1
12

with g++ 3.4 (-W -Wall -pedantic) and icc 8.0 (-strict_ansi).

Jim





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