Boost logo

Boost :

From: Ruslan Zasukhin (sunshine_at_[hidden])
Date: 2002-06-25 01:19:36


on 6/25/02 3:26, Douglas Gregor at gregod_at_[hidden] wrote:

Hi Douglas,

> 2) Why use the vtable idiom when the variant is completely bounded? The
> vtables are quite a bit larger than the single byte needed to specify which
> type of the variant is selected, and I don't see any benefit to the vtable
> approach.

I have not see yet sources, but I have see that Eric do conversion of types.
So I can assume only that he use trick "double swap" based on vtable.

> 3) I'd really like to see the ability to construct from a type convertible to
> some value that the variant can store, e.g.,
>
> boost::variant<int, float, string> v(3.14159); // convert double to float
>
> I'm glad to see work on a variant type. It's been discussed a million times,
> but we've never had a variant type come up for review (and I've needed one
> for a LONG time).

I have work on similar task in Valentina database not so far.
But I have made code using Interface way.

So I wonder (note, I am new to boost)

    Why boost org always try go by template way only ?
    Why I do not see solutions based on interfaces ?

-- 
Best regards,
Ruslan Zasukhin              [ I feel the need...the need for speed ]
---------------------------------------------------------------------
ParadigmaSoft                            http://www.paradigmasoft.com
Valentina is cross-platform, fantastic fast database engine, supports
C/C++, Java, SQL, REALbasic, Director, XCMD, COM, Visual BASIC, ...
---------------------------------------------------------------------

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