Boost C++ Libraries: Ticket #1227: Original/Signed/Unsigned Integer Variant Selection Templates https://svn.boost.org/trac10/ticket/1227 <p> Add new integer selection templates to "boost/integer.hpp" for </p> <ul><li> The underlying type for a given integral type. This could be called <code>underlying</code> and would map <ul><li> <code>char</code> to whichever of {<code>signed char</code>, <code>unsigned char</code>} that shares the same values (section 3.9.1, paragraph 1 of the 2003 C++ standard) </li><li> <code>wchar_t</code> to its underlying type (paragraph 5 of the same part of the standard) </li><li> any other type to itself (This includes <code>bool</code> because it could be implemented distinctly from any other integral type.) </li><li> (Someday: extend this to find the underlying type of an enumeration) </li></ul></li><li> Find the unsigned equivalent of a given signed integral type, like the <code>get_unsigned</code> examples at source:/tags/Version_1_34_1/boost/boost/typeof/int_encoding.hpp and source:/tags/Version_1_34_1/boost/boost/wave/util/flex_string.hpp </li><li> Find the signed equivalent of a given unsigned integral type, as a dual to the previous point (for both templates, non-matching types return themselves) </li></ul> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1227 Trac 1.4.3 Daryle Walker Sun, 13 Jul 2008 21:59:21 GMT <link>https://svn.boost.org/trac10/ticket/1227#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1227#comment:1</guid> <description> <p> The last two points are already fulfilled by the Type Traits library via the [source:/trunk/boost/type_traits/make_signed.hpp@42899 boost::make_signed] and [source:/trunk/boost/type_traits/make_unsigned.hpp@42899 boost::make_unsigned] class templates. </p> </description> <category>Ticket</category> </item> </channel> </rss>