|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2002-10-27 00:09:15
"Eric Niebler" <neric_at_[hidden]> writes:
> On Sun, 27 Oct 2002 02:30:32 +0300, Gennadiy Rozental wrote:
>
> > I always wondered why we need to struggle that much to dig the information
> > from a compiler in writing generic components, while it should be very easy
> > for the compiler to provide direct access to this information. And BTW it
> > could give much more then we could achieve now with template tricks.
> > Is there formal proposition to the core group to add this kind of
> > facility to language? So that I could write something like:
> > T.has_default_constructor or T.has_field["member"]
> >
> > Gennadiy.
> >
>
>
> I don't know if this is officially before the committee, but Bjarne has
> been working on this for quite some time. It's called XTI, for extended
> type information.
But that's got nothing to do with compile-time traits. XTI is a
prototype system for generating information about your classes and
functions /after/ compilation, by snarfing data from its debug
symbols. There's no way that's going to lead to compile-time support
for introspection, except by very indirect paths.
> A google search for XTI and Stroustrup turns up lots of stuff, like
> http://atlassw1.phy.bnl.gov/wenaus/docs/cern/XTI_accu.pdf
Yes, but unfortunately no code... :( I'm just pointing this out
because many people have been waiting a long time to get a glimpse of
XTI, and I think at this point nobody should delay progress based on
the supposedly imminent solutions it will provide (especially those it
never promised). In particular, if Gennadiy would like to see direct
core support for type introspection at compile-time he should consider
writing a proposal himself.
-- David Abrahams dave_at_[hidden] * http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk