Boost Users :
Subject: Re: [Boost-users] Needs advices on design ( mpl or processor )
From: Allan Nielsen (a_at_[hidden])
Date: 2012-01-09 17:23:26
I have been reading you code, and refactoring my own proposals several
times. I'm not used to this kind of meta programming, so it did take
me quite some time to understand the code you have proposed, but I'm
learning, so thank you..
I will try to answer the questions
>Here's where I don't understand why the calculation are done outside
>the temple and then passed as args to the template.
>Why not have a template do the calculations and accumulate the results,
>somewhat like mpl::fold or the code I posted earlier?
This might also be the very core of my problem. I did some tries where
I used the c++11 "using" facility to bind all the template arguments
except the offset, it did work, but the usage of the interface was not
Instead I have now fractured the design to avoid the this calculation
outside (like you suggested). This seems to work out better.
>The output before the putting: lines is caused by the obviously
>erroneous initialization of the buffer (no Enum e's stored in
>the buffer, only unsigned ints). The output after the putting: lines
>shows the effect of the put<Tag,Enum>(Enum e).
>However, be warned! I'm not sure all the casting within the get_ol
>and put_ol is portable.
>Is this about what you want?
Pretty much, plus some extra stuff ;-)
- It must be possible to specify arrays of enums
- It must be possible to group enums.
But I think I got some ideas to move on, so thanks a lot.
Allan W. Nielsen
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net