Boost logo

Boost :

From: Hubert Holin (Hubert.Holin_at_[hidden])
Date: 2005-02-28 09:18:28


Somewhere in the E.U., le 28/02/2005

   Bonjour

In article <cvnrf3$t81$1_at_[hidden]>,
 "Gennadiy Rozental" <gennadiy.rozental_at_[hidden]> wrote:

> > It would also help if you added the construct you wrote
> >
> > template<typename T>
> > struct string_type_name;
> >
> > #define DEFINE_TYPE_NAME(Type) \
> > template<> struct string_type_name<Type> \
> > { \
> > static char const * _() \
> > { \
> > return #Type; \
> > } \
> > }
> >
> >
> > to a common header, as I believe I am not the only one who would benefit
> > from it!
>
> Usually I am using RTTI for this king of task. But I will think about it.

      I agree RTTI *should* be the tool for this, but unfortunately,
there are no guaranty that the string associated by the RTTI system with
the type be anything (humanly) sensible. Furthermore, it may (IIRC)
alias types, which is something I want to avoid here. That's why having
this functionality, so as to work in tandem with
BOOST_TEST_CASE_TEMPLATE, appear in a Boost.Test header, would be a good
thing.

> (MPL book have an excesize to do just something like this)

      I know I will have to buy it, I know I will have to find the time
to read it ;-) .

   Merci

         Hubert Holin


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