"Dirk Gerrits" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
> At what cost? The strings you generate are indeed very readable, but
> specializing spelling for every type that might be a template parameter
> someday seems like too much of a burden to me.
>
> Others might disagree though...

I think that is a problem too. Maybe a macro could make things easier:

#define DECLARE_SPELLABLE( a_type ) \
template<> class spelling<a_type> { public: static const std::string
result; }; \
const std::string spelling<my_enum>::result = #a_type

but this should be preferrable be put in headers, so why not make the static
data into a function instead?
Like this:

template< typename T >
class spelling
{
public:
    const string& result() const
   {
       static const string res = ..;
       return res;
   }
};

And the macro could be changed accordingly.

regards

Thorsten



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to