[Boost-bugs] [Boost C++ Libraries] #12504: Use types from <cinttypes> in boost::uint_t and boost::int_t

Subject: [Boost-bugs] [Boost C++ Libraries] #12504: Use types from <cinttypes> in boost::uint_t and boost::int_t
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-10-07 20:44:01


#12504: Use types from <cinttypes> in boost::uint_t and boost::int_t
------------------------------+----------------------
 Reporter: john@… | Owner: dlwalker
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: integer
  Version: Boost 1.61.0 | Severity: Problem
 Keywords: |
------------------------------+----------------------
 I'd like to suggest that instead of using built-in types to implement
 `boost::uint_t` and `boost::int_t` that the explicitly sized types from
 <cinttypes> be used.

 Take for instance
 [https://github.com/boostorg/integer/blob/develop/include/boost/integer.hpp#L67
 this definition]:
 {{{
 template<> struct int_least_helper<4> { typedef short least; };
 }}}

 Is there any reason not to replace `short` with `std::int16_t` in this
 line?

 My (entirely selfish) reason to suggesting this is that I've hit [https
 ://travis-ci.org/johnmcfarlane/fixed_point/builds/165888344 an odd case]
 in code I am writing in which `boost::uint_t<64>::fast` is a different
 type to `std::uint64_t`. It would appear that `std::uint64_t` is defined
 as `unsigned long long` under XCode 7 but `unsigned long` under XCode 6. I
 fear that weirdness like this is inevitable given the many combinations of
 widths which built-in integer types can assume. But using the known-width
 types provided by <cinttypes> would seem like a more reliable way to
 proceed.

 Many thanks,
 John McFarlane

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12504>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC