|
Boost : |
From: Frank Laub (frank.laub_at_[hidden])
Date: 2005-12-08 20:37:11
>
> Is it not possible to go for
>
> typedef boost::array<const char*, size+1> array_type
>
> ?
Ah, yes, that's a terrific suggestion. Thanks.
and maybe a CT version:
>
> template< type index >
> inline const char* str()
> {
> BOOST_STATIC_ASSERT( index > Invalid );
> return names[(int)index];
> }
This is good too, but I think I'd still want a runtime version so that I can
use it for an ostream operator. It seems a little weird to use:
const char* str = Level::str<Level::Error>();
Hmm, wish it could look more elegant :p
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk