Boost logo

Boost :

From: Rozental, Gennadiy (gennadiy.rozental_at_[hidden])
Date: 2003-04-11 14:09:32


> -----Original Message-----
> From: Peter Dimov [mailto:pdimov_at_[hidden]]
> Sent: Wednesday, April 09, 2003 7:42 AM
> To: Boost mailing list
> Subject: Re: [boost] [mpl]gcc and bcc link errors
>
>
> David Abrahams wrote:
> > "Gennadiy Rozental" <gennadiy.rozental_at_[hidden]> writes:
> >
> >> #include "boost/mpl/int.hpp"
> >>
> >> template<typename T>
> >> void foo( T const& t ) {}
> >>
> >> int main() {
> >> foo( boost::mpl::int_<1>::type::value );
> >>
> >> return 0;
> >> }
> >
> > Just with Borland as far as I can tell. This passes gcc 2.95.3 and
> > 3.2
> > and fails Borland 5.5.1, which is so bad I can't be very surprised.
>
> This example, IMO, must fail. Passing a static const by
> reference requires a
> definition. AFAICS mpl::int_<> does not provide one. But I'm
> not up to date
> with the latest core issues.

What would be the correct way?

Here is the original code snippet:

template<typename T>
void foo()
{
     BOOST_CHECK_EQUAL( 2, T::type::value );
}

How could I rewrite to eliminate link errors?

Gennadiy.


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