ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
Re: [boost] Traits for character underlying types
by Jens Maurer other posts by this author
Feb 21 2001 10:12PM messages near this date
Traits for character underlying types | [boost] Recover MSVC auto-complete with smart pointers?
Daryle Walker wrote:
> 
>  The char type is supposed to be like either signed char or unsigned
>  char, which one is implementation defined. Similarly, the wchar_t type
>  is supposed to be like one of the other integral types, which one is
>  implementation defined. Could we have some sort of structure indicating
>  those types' base types?

Please have a look at the newly updated boost/type_traits
You'd have to apply some compile-time-if magic (we don't seem to have
a template metaprogramming library yet).

numeric_limits<char> ::is_signed helps you decide the signedness
issue

In boost/integer.hpp, there's int_t<N> , so for usual 8bit chars,
int_t<sizeof(wchar_t)*8> ::least may be another option (check
for signedness as with char ).

Anyway, for most of the more arcane template stuff, I'd rather
see an example why it's really useful, e.g. to know the type
underlying a char (you can always find out the signedness
with numeric_limits<char> ::is_signed, that's not the point).

Jens Maurer
Thread:
Daryle Walker
Jens Maurer

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved