From 8c36890e7714d88d61dfc2b19db1d7b78c17b091 Mon Sep 17 00:00:00 2001
From: Beman
convert
function templates.
int16_t reverse_value(int16_t x) noexcept; +int8_t reverse_value(int8_t x) noexcept; +int16_t reverse_value(int16_t x) noexcept; int32_t reverse_value(int32_t x) noexcept; int64_t reverse_value(int64_t x) noexcept; +uint8_t reverse_value(uint8_t x) noexcept; uint16_t reverse_value(uint16_t x) noexcept; uint32_t reverse_value(uint32_t x) noexcept; uint64_t reverse_value(uint64_t x) noexcept; @@ -215,14 +213,8 @@ double reverse_value(double x) noexcept;Returns:
-x
, with the order of its constituent bytes reversed.void reverse(int16_t& x) noexcept; -void reverse(int32_t& x) noexcept; -void reverse(int64_t& x) noexcept; -void reverse(uint16_t& x) noexcept; -void reverse(uint32_t& x) noexcept; -void reverse(uint64_t& x) noexcept; -void reverse(float& x) noexcept; -void reverse(double& x) noexcept;+template <class Value> + void reverse(Value& x) noexcept;Postconditions: The order of the constituent bytes of
@@ -333,10 +325,12 @@ provided.x
are reversed.Acknowledgements
Tomas Puverle was instrumental in identifying and articulating the need to -support endian conversion as separate from endian integer types. Phil Endecott suggested the form of the value returning signatures. Vicente Botet and other reviewers suggested supporting floating point types and user defined types. General reverse template implementation approach using std::reverse suggested by Mathias Gaunard. Portable implementation approach for 16, 32, and 64-bit integers suggested by tymofey, with avoidance of undefined behavior as suggested by Giovanni Piero Deretta, and a further refinement suggested by Pyry Jahkola. Intrinsic builtins implementation approach for 16, 32, and 64-bit integers suggested by several reviewers, and by David Stone, who provided his Boost licensed macro implementation that became the starting point for boost/endian/detail/intrinsic.hpp.
+support endian conversion as separate from endian integer types. Phil Endecott suggested the form of the value returning signatures. Vicente Botet and other reviewers suggested supporting floating point types and user defined types. General reverse template implementation approach using std::reverse suggested by Mathias Gaunard. Portable implementation approach for 16, 32, and 64-bit integers suggested by tymofey, with avoidance of undefined behavior as suggested by Giovanni Piero Deretta, and a further refinement suggested by Pyry Jahkola. Intrinsic builtins implementation approach for 16, 32, and 64-bit integers suggested by several reviewers, and by David Stone, who provided his Boost licensed macro implementation that became the starting point for boost/endian/detail/intrinsic.hpp. +Pierre Talbot provided theint8_t reverse_value()
and templated +reverse()
implementations.
Last revised: -29 May, 2013
+16 April, 2014© Copyright Beman Dawes, 2011, 2013
Distributed under the Boost Software License, Version 1.0. See www.boost.org/ LICENSE_1_0.txt
diff --git a/doc/done_list.html b/doc/done_list.html index 23ccd3d..cba161d 100644 --- a/doc/done_list.html +++ b/doc/done_list.html @@ -16,9 +16,7 @@ 64-bit(double)
floating point, as requested.
reverse_value()
overloads for int8_t
and
+ uint8_t
have been added for improved generality. (Pierre Talbot)reverse()
have been replaced with a single
+ reverse()
template. (Pierre Talbot)