> 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.

Looks good to me.

Robert

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

Reply via email to