|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-17 08:54:38
I never understood what the benefits of doing it differently might be, so I
had nothing to say. If it is just an implementation detail, and it avoids
generating lots of template instantiations at a fairly low cost in
preprocessing time, that it's a marvelous idea.
-Dave
----- Original Message -----
From: "Aleksey Gurtovoy" <alexy_at_[hidden]>
To: <boost_at_[hidden]>
Cc: <roland_at_[hidden]>
Sent: Thursday, January 17, 2002 8:44 AM
Subject: RE: [boost] Re: Any interest for a parser class?
> Vladimir Prus wrote:
> > Again, I'd like to see numbers. After bcc has converted
> >
> > tuple<int, int> t(1, 2)
> >
> > in 40 assembly instructions, I don't believe much in optimization
> > capabilities of compilers.
>
> Yet it is entirely possible to implement the tuple facilities in the way
> that the above statement will give you the same assembly code as
> "std::pair<int, int> p(1, 2)" - instruction to instruction. Before you ask
> how :), here is my answer - using PREPROCESSOR library. In some sense,
such
> implementation could even be simpler (no template magic, but preprocessor
> one instead ;), and more flexible, in sense that you could configure the
> maximum size of a tuple "container" by simple #define, e.g. #define
> BOOST_TUPLE_SIZE 15. Of course, the approach also has it's drawbacks -
> debugging/compile-time errors localization difficulties is the major one,
> but they are solvable as well.
>
> In fact, some times ago Roland Richter has posted here an announcement of
> something that, I think, is very close to what I have in mind (I haven't
> look at the code) - see http://groups.yahoo.com/group/boost/message/21094.
> But it looks like nobody is interested in "tuple<int, int> t(1, 2)" that
> generates 4 instead of 40 assembly instructions ;). Is it so?
>
> (Sorry Roland, I _did_ plan to respond, - I have done a very similar thing
> with mpl::type_vector<>, - but got buried in other things...)
>
> Aleksey
>
> Info: http://www.boost.org Send unsubscribe requests to:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk