Boost logo

Boost :

From: Lin Xu (risingdragon3_at_[hidden])
Date: 2003-05-07 21:23:13


>Yes, this is well-known technique known as curiously recurring template
>pattern. I don't see any difficulties here. The rule is extermely simple
>and it takes a second to follow it.

I know. I know the pattern, it is not what I was talking about. Perhaps I
should have been more specific, I was referring to the
.. std::ostream & (std::ostream &, const anyT &)
That you have to parse. I believe boost.Function does that already, the
parsing of the template argument, I mean; and the docs say that the
"compatibility" syntax is used for older compilers.
But that's not really a big deal...because I understand now!

>I don't understand what do you mean by "distinguish".
Nevermind, I didn't understand.

>move()(a, 10, 10);
This explained everything. I understand now.

You implemented a dynamic any visitor whereas I implemented a mixin class.
But we both implemented the same functionality. Except, that you can visit
using an arbitary class. Very cool: but ...
to clarify; does the move class need to be defined in the any type?
ie..
typedef dynamic_any<move> some_any;
some_any a;

Or can I just do
dynamic_any<> a;

?
Another question: I see that you call operator() on the visting object. I
dont' see that explicitly defined in the move class by the user. I would
assume it woudl be defined by the dynamic_any, except you did define it in
the io_any test. Thanks for letting me pick your brains :)

>One problem that I see right now is a single interface bottleneck.
Well, there isn't. I avoidedd that issue, but today I implemented multiple
ones using a mpl::list. It wasn't difficult; I just hadn't implemented it at
the time I wrote the email.

However I think mine is not superior to yours, except maybe in syntax. (I
still don't like the seperate syntax move()(....)). That's just coming from
where I began my any, which was from the idea of a mixin..not a dynamic
visitor in which case it makes sense. However, if all one wanted was a sort
of forwarding function that would call the same function in the any, then
the any->function_call() seems more natural.

Comments? awaiting answers to my questions :)

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk