incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: Some internal aliases for __rw_integral_constant?
Date Tue, 24 Jun 2008 23:11:11 GMT
Eric Lemings wrote:
>  
> Propose adding the following defs (or something similar) to
> <rw/_meta_help.h> primarily for our own convenience:
>  
> template <bool _Bool>
> class __rw_bool_const: public __rw_integral_constant<bool, _Bool> {};

I was going to suggest the same thing this morning when I noticed
how pervasive __rw_integral_constant<bool, _Bool> seems to be in
traits definitions (I count 41 occurrences) and thinking that it
would make them less verbose. (With a different spelling of _Bool
to avoid potential clashes with the C99 name.)

I didn't because the only beneficiaries of the change would be us
(a fairly small notational convenience) and I wasn't sure the cost
in terms of the added complexity and compilation time was worth it.
I contemplated suggesting a macro for the same purpose instead but
decided against it on the assumption that it probably wouldn't be
very popular ;-) But now that the cat's out of the bag and you're
asking about alternatives let me throw it out there:

#define _RWSTD_BOOL_CONST(B) _RW::__rw_integral_constant<bool, B>

Usage:

      _RW::__rw_bool_const<bool, false>
   vs
     _RWSTD_BOOL_CONST (false)

>  
> template <int _Int>
> class __rw_int_const: public __rw_integral_constant<int, _Int> {};
>  
> template <_RWSTD_SIZE_T _Size>
> class __rw_size_const: public __rw_integral_constant<_RWSTD_SIZE_T,
> _Size> {};
> 
> The name __rw_integral_constant is a bit too long for the amount of
> usage that I'm anticipating.

AFAICS, there are just 9 occurrences of the size_t specializations
but none of the int one.

Martin

> Or am I being premature?
> 
> Thoughts?  Alternatives?
> 
> Brad.


Mime
View raw message