Subject: Re: [boost] [vmd] Library Review
From: Edward Diener (eldiener_at_[hidden])
Date: 2014-09-14 22:59:45
On 9/14/2014 10:34 PM, Paul Mensonides wrote:
> On 9/14/2014 5:12 PM, Edward Diener wrote:
>> On 9/14/2014 6:49 PM, Paul Mensonides wrote:
>>> The BOOST_PP_AUTO_REC macro is used to find the first macro of a set of
>>> macros which has not been painted (i.e. will expand). It requires a set
>>> of macros which are a power of 2 which are used in order.
>> Here is my understanding of what BOOST_PP_AUTO_REC does from your
>> example. It takes a function-like macro name and a parameter which is a
>> Boost PP number which is a power of 2, from a minimum of 2 to a maximum
>> of 256. It then calls the function-like macro name passing a number
>> starting with 1 through the number passed to it. If the function-like
>> macro returns 1 it stops and returns the current number else it
>> continues with the next number. I won't ask what BOOST_PP_AUTO_REC
>> returns if its function-like macro never returns 1 before it finishes
>> cycling through its numbers <g>.
> Yes, except that it does a binary rather than linear search, so it can
> search a fairly large set with minimal invocations of the predicate.
Still better. Good to know.
>>> The alternate registration mechanism (excluding the comma in the
>>> registration itself) that you guys realized is good and is obvious is
>>> retrospect. That would make the registration much cleaner.
>> I agree. Your proposal is obvious in retrospect but it is like the
>> legendary story of Christopher Columbus and the egg.
>> I am now very glad I can make a v-sequence much easier with better
>> functionality. Why I didn't think of your solution to being with ... <g>.
> Sorry, I meant excluding the comma in the registration was obvious to me
> in retrospect, but I didn't think of it at the time.
> I think that removing the existing length (etc.) limitations on
> v-sequences will make things much more usable--and make the
> documentation much much simpler.
Absolutely. It will also make the implementation of v-sequences much
simpler. The whole business of trying to identify identifiers and
numbers in a v-sequence the way I was doing it, even though it worked,
imposed limitations which I am now glad to do without. With your
suggestion I can throw all that onerous code away. It was a burden to do
it and I am glad to be able to get rid of it for a much better and
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk