Boost logo

Boost :

From: Dave Jenkins (david_at_[hidden])
Date: 2007-10-29 20:27:26


"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:01bf01c81a67$bc9ae2c0$6407a80a_at_pdimov2...
> The current registration interface requires me to #include
> <boost/typeof.hpp>, then #include BOOST_TYPEOF_SOMETHING(), then use a
> macro. These headers in turn include MPL headers, PP headers and who knows
> what else.
>
> I'm saying that if the registration interface did not require me to
> include
> any header, then I'd be willing to register all my types and templates at
> the point of their definition.

Rather than registering your types and templates at their point of
definition,
I think it's better to put them in a separate header file. That header file
is only needed by a user whose compiler doesn't provide a native typeof
operator or an exploit of a compiler bug to discover types.

So far, we've been lucky (and smart) enough to discover MSVC bugs that
eliminate the need for typeof registrations on those compilers. But if
Microsoft were to fix the bug in a service pack, we'd be SOL without type
registrations.

So why not have each library create a file in
$BOOST_ROOT/boost/typeof_registrations
named "MyLibrary_typeof.hpp". The file would (1) include the
<boost/typeof/typeof.hpp> header,
(2) include the <boost/typeof_registrations/OtherLibrary_typeof.hpp> files
for libraries that it
uses and (3) specify all of its own type and template registrations.


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