|
Boost : |
Subject: Re: [boost] Enums: naming question?
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2011-03-21 11:26:04
On Mon, Mar 21, 2011 at 12:42 AM, Vicente Botet <vicente.botet_at_[hidden]>wrote:
>
> Max Sobolev wrote:
> >
> > On 19.03.2011 23:12, Vicente Botet wrote:
> > >
> > > Jeffrey Lee Hellrung, Jr.-2 wrote:
> > >>
> > >> Then all I can suggest as a better name is *maybe* scoped_type
> or
> > >> scoped_enum_type. But scoping_type might be fine.
> > >>
> > >
> > > Hmm, scoping_type and scoped_enum_type seems reasonable, but I
> prefer
> > yet
> > > the use of native_type. What do others think?
> >
> > I like scoped_enum_type name :)
> >
> >
>
> Sorry, I think I misunderstood Jeffrey.
>
> were you proposing to replace scoping_type by scoped_enum_type or or
> scoped_type and let native_type as now?
>
The quote referred to replacing scoping[_type] with either scoped[_type] or
scoped_enum[_type] (I like the latter better). I had already commented that
I think native_enum[_type] would be clearer than native[_type] and
underlying_integer[_type] clearer than underlying[_type] (although this
latter case is already called underlying_type in the standard, right?).
Robert Stewart brought up a good point on the redundancy of the "_type"
suffix, so although the above alternatives to your current metafunction
names are longer, that will be mostly mitigated by removing the redundant
"_type" suffix. However, we do have free function analogues of these
metafunctions, correct? Maybe you can put the metafunctions in a result_of
namespace, as Boost.Fusion does?
[I'm hoping the angle brackets get preserved...]
namespace result_of{
template< class E > struct native_enum;
template< class E > struct underlying_integer;
template< class E > struct scoped_enum;
} // namespace result_of
template< class E >
typename result_of::native_enum<E>::type
native_enum(const E e);
// etc.
- Jeff
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk