|
Boost : |
From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2002-05-30 01:02:47
From: "Vesa Karvonen" <vesa_karvonen_at_[hidden]>
> Cool! This technique should work on all preprocessors. Yesterday I
> wrote an implementation of the WHILE macro that does not require one to
> explicitly pass the recursion depth as a parameter. (I don't have access
> to the CVS at the moment.)
By the way, you can also use this to calculate the current number of available
WHILE's:
#define WHILE_MAG_CURRENT() PRIVATE_CONCAT(WHILE_MAG_CURRENT_, WHILE())
// say you have three WHILE constructs:
// WHILE_1ST, WHILE_2ND, and WHILE_3RD
#define WHILE_MAG_CURRENT_(err) 0
#define WHILE_MAG_CURRENT_WHILE_1ST 3
#define WHILE_MAG_CURRENT_WHILE_2ND 2
#define WHILE_MAG_CURRENT_WHILE_3RD 1
This could help with debugging, I think. Maybe when you are trying to find a
problem.
Paul Mensonides
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk