
________________________________ From: Paul Mensonides <pmenso57@comcast.net> To: boost@lists.boost.org Sent: Saturday, April 21, 2012 10:17 PM Subject: Re: [boost] [preprocessor] Sequences vs. All Other Data Structures
On Sat, 21 Apr 2012 17:42:25 -0400, Dave Abrahams wrote:
on Sat Apr 21 2012, Nathan Ridge <zeratul976-AT-hotmail.com> wrote:
Slightly off-topic: are there any plans to add Chaos to Boost?
+1
As some sort of technological preview? It is not portable enough to be used within Boost, though perhaps a slew of regression failures will cause that to change (unlikely). <rant>MS, in particular, is too busy taking it upon themselves to "ensure C++ is relevant" to prioritize implementing the language.</rant> Also, one of the principles of Chaos is to have absolutely zero compiler workarounds, and that would have to stay if it was ever part of Boost.
There are workarounds for most of the library. How well does active arguments work with msvc? Are there possible workarounds? I know I used the PP_DEFER macros before in msvc, which worked quite well. I used them to actually workaround the fact that msvc implements the "and, not, or, etc" keywords as macros, which can make it difficult to cat them, or detect if the keyword was there or not. So the macro by themselves would expand to their appropriate operator, but if they were expanded inside of PP_CONTEXT() macro, then they would expand to something else. Like this: #define not PP_CONTEXT_DEFINE(PP_MSVC_NOT, !) not //expands to ! PP_CONTEXT(not) //expands to PP_MSVC_NOT So I used the PP_DEFER macro to delay the macro expansion for one scan. Then it detects if PP_CONTEXT is being expanded recursively, and then chooses the alternate macro. There is also an PP_EXPAND that is needed, as well. It can work through several scans, too, by having a nested PP_DEFER for each scan(and a corresponding PP_EXPAND). I actually got the idea for this from the CHAOS_PP_RAIL and CHAOS_PP_WALL macro, which is used for a different purpose. But anyways, I wonder if its even possible(with workarounds) to implement recursion from chaos in msvc?