On Mon, Sep 10, 2012 at 10:01 AM, Florian Weimer <fwei...@redhat.com> wrote:
> On 09/10/2012 04:53 PM, Gabriel Dos Reis wrote:
>
>> It is not clear what the benefit is to move existing perfectly working
>> internal non-member functions to being member functions a huge struct.
>
>
> I did this with cxx_eval_constant_expression and the functions it uses
> internally.  The advantage is that you do not have to thread manually all
> the state arguments, and it is trivial to add additional state to pass
> around.

Florian, I was not making a blanket statement in the abstract.
Rather, I was commenting on the specific patch that Aaron posted.
That cannot possibly be called "encapsulation."

> You could also do this with an explicit pointer-to-context-struct parameter
> that's passed around (and that version of the patch I posted), but the
> class-based approached seems nicer to me.

Are we talking about encapsulation or "looking nice"?
In either case,  I respectfully disagree -- talking specifically about
the patch posted.
Having a giant struct with a zillion of member functions defies any
reasonable notion of "looking nice", and of "encapsulation."


-- Gaby

Reply via email to