
25 Apr
2005
25 Apr
'05
9:55 p.m.
michael toksvig schrieb:
What is your evaluation of the documentation?
describe pitfalls, if any. actually, there is one pitfall:
BOOST_FOREACH(pair<Key, Value> &p, some_map)
does not work, since the preprocessor just can't get over that first comma
this could be worked around with C99 variadic macros if available, something like: #define _BOOST_FOREACH2(a1,a2,...) BOOST_FOREACH2(a1,a2) #define _BOOST_FOREACH3(a1,a2,a3,...) BOOST_FOREACH3(a1,a2,a3) // ... #define _BOOST_FOREACH(a1,a2,a3,a4,a5,a6,a7,a8,a9,nr,...) _BOOST_FOREACH##nr(a1,a2,a3,a4,a5,a6,a7,a8,a9) #define BOOST_FOREACH(...) _BOOST_FOREACH(__VA_ARGS__,9,8,7,6,5,4,3,2,1) -- Stefan Strasser