From: d.frey_at_[hidden]
Date: 2000-12-01 12:37:59


--- In boost_at_[hidden], Kevlin Henney <kevlin_at_c...> wrote:
> In message <90876s+i8vd_at_e...>, d.frey_at_g... writes
>
> >/* How to specialize for T == S ???
> >
> >template< typename U > template<> U lexical_cast< U, U >( U arg )
> >{
> > cout << "X.";
> >
> > return arg;
> >}
> >
> >*/
>
> Requires partial function template specialisation, which we don't
have
> in the language. You can overload but not specialise.

Hm. Too bad... :(

> >// This only work for lexical_cast's argument being declared as 'S
> >arg' and not 'const S& arg'
> >template<> string lexical_cast< string, const char* >( const char*
arg
> >)
> >{
> > cout << "3.";
> >
> > return string( arg );
> >}
>
> Did you also try this with const char *& rather than plain const
char *?

Yes, but I didn't get the compiler to accept it. Probably my fault or
it's the gcc... I'll try it again on Monday, when I'm back at the
office.

Regards, Daniel