
Larry Evans wrote:
Thanks for your responses, David.
Sure thing.
However, in addition, if variant (i.e. sum) is thrown onto the scales, then I believe easier undestanding wins.
Maybe you're not the best judge of easy understanding.
I completely agree.
You snipped the context. My point was that you managed to confuse me by talking about stuff like sum and product without any introduction to what they were.
I believe it's pretty typical that the coder initially believes his code is easier to understand than reviewers would say.
However, I'd guess that one attempting to understand product would simply look at the project<Index> code, then at the factor<,, Index> superclass to find my_field of type TypeMap<Index>::type and understand product.
???? You're off in some other dimension again. Did I miss all this from an earlier post ???? What is product, project, factor, my_field, and what language is factor<,, Index> ??
OTOH, as reflected in my previous response terminated with :( , understanding how tuple accessed the selected fields seemed much harder, at least to me. Maybe you could give a brief description of the thought process you went through in understanding product.
I didn't. I have no clue what you're talking about.
What does variant have to do with sum? It's completely non-obvious to me.
Well, maybe that's part of the problem. Are you assuming sum has something to do with numbers. I'd meant it to mean disjoint sum applied to types, and of course variant does model disjoint sum. Is that the reason for the disconnect (of our mutual understanding) ?
Maybe. You do seem to be assuming all kinds of background vocabulary I don't have.
In addition, I think sum can be modified by adding:
term<...Index>::accept(visitor&a_viz) { if(index() == Index) { a_viz(mpl::int_c<Index>(), project<Index>());} else { term<...,Index-1>::accept(a_viz);} }
which is essentially the visitor pattern.
You've lost me completely.
Well, I had assumed you'd looked at sum.hpp
What sum.hpp?? -- Dave Abrahams Boost Consulting http://www.boost-consulting.com