mirror of
https://github.com/boostorg/endian.git
synced 2025-07-31 13:07:24 +02:00
Remove commented out code residue from treating native as a synonym for big or little.
This commit is contained in:
@@ -338,22 +338,10 @@ namespace endian
|
||||
// Primary template and specializations to support convert_value(). See rationale in convert_value() below.
|
||||
template <BOOST_SCOPED_ENUM(order) From, BOOST_SCOPED_ENUM(order) To, class Reversible>
|
||||
class value_converter ; // primary template
|
||||
// template <class T> class value_converter <order::native, order::native, T> {public: T operator()(T x) BOOST_NOEXCEPT {return x;}};
|
||||
template <class T> class value_converter <order::big, order::big, T> {public: T operator()(T x) BOOST_NOEXCEPT {return x;}};
|
||||
template <class T> class value_converter <order::little, order::little, T> {public: T operator()(T x) BOOST_NOEXCEPT {return x;}};
|
||||
template <class T> class value_converter <order::big, order::little, T> {public: T operator()(T x) BOOST_NOEXCEPT {return reverse_value(x);}};
|
||||
template <class T> class value_converter <order::little, order::big, T> {public: T operator()(T x) BOOST_NOEXCEPT {return reverse_value(x);}};
|
||||
//# ifdef BOOST_BIG_ENDIAN
|
||||
// template <class T> class value_converter <order::native, order::big, T> {public: T operator()(T x) BOOST_NOEXCEPT {return return x;}};
|
||||
// template <class T> class value_converter <order::native, order::little, T> {public: T operator()(T x) BOOST_NOEXCEPT {return reverse_value(x);}};
|
||||
// template <class T> class value_converter <order::big, order::native, T> {public: T operator()(T x) BOOST_NOEXCEPT {return x;};
|
||||
// template <class T> class value_converter <order::little, order::native, T> {public: T operator()(T x) BOOST_NOEXCEPT {return reverse_value(x);}};
|
||||
//# else // BOOST_LITTLE_ENDIAN
|
||||
// template <class T> class value_converter <order::native, order::big, T> {public: T operator()(T x) BOOST_NOEXCEPT {return reverse_value(x);}};
|
||||
// template <class T> class value_converter <order::native, order::little, T> {public: T operator()(T x) BOOST_NOEXCEPT {return x;}};
|
||||
// template <class T> class value_converter <order::big, order::native, T> {public: T operator()(T x) BOOST_NOEXCEPT {return reverse_value(x);}};
|
||||
// template <class T> class value_converter <order::little, order::native, T> {public: T operator()(T x) BOOST_NOEXCEPT {return x;}};
|
||||
//# endif
|
||||
}
|
||||
|
||||
// compile-time generic convert return by value
|
||||
@@ -420,22 +408,10 @@ namespace endian
|
||||
// Primary template and specializations to support convert(). See rationale in convert() below.
|
||||
template <BOOST_SCOPED_ENUM(order) From, BOOST_SCOPED_ENUM(order) To, class Reversible>
|
||||
class converter; // primary template
|
||||
// template <class T> class converter<order::native, order::native, T> {public: void operator()(T&) BOOST_NOEXCEPT {/*no effect*/}};
|
||||
template <class T> class converter<order::big, order::big, T> {public: void operator()(T&) BOOST_NOEXCEPT {/*no effect*/}};
|
||||
template <class T> class converter<order::little, order::little, T> {public: void operator()(T&) BOOST_NOEXCEPT {/*no effect*/}};
|
||||
template <class T> class converter<order::big, order::little, T> {public: void operator()(T& x) BOOST_NOEXCEPT {reverse(x);}};
|
||||
template <class T> class converter<order::little, order::big, T> {public: void operator()(T& x) BOOST_NOEXCEPT {reverse(x);}};
|
||||
//# ifdef BOOST_BIG_ENDIAN
|
||||
// template <class T> class converter<order::native, order::big, T> {public: void operator()(T&) BOOST_NOEXCEPT {/*no effect*/}};
|
||||
// template <class T> class converter<order::native, order::little, T> {public: void operator()(T& x) BOOST_NOEXCEPT {reverse(x);}};
|
||||
// template <class T> class converter<order::big, order::native, T> {public: void operator()(T&) BOOST_NOEXCEPT {/*no effect*/}};
|
||||
// template <class T> class converter<order::little, order::native, T> {public: void operator()(T& x) BOOST_NOEXCEPT {reverse(x);}};
|
||||
//# else // BOOST_LITTLE_ENDIAN
|
||||
// template <class T> class converter<order::native, order::big, T> {public: void operator()(T& x) BOOST_NOEXCEPT {reverse(x);}};
|
||||
// template <class T> class converter<order::native, order::little, T> {public: void operator()(T&) BOOST_NOEXCEPT {/*no effect*/}};
|
||||
// template <class T> class converter<order::big, order::native, T> {public: void operator()(T& x) BOOST_NOEXCEPT {reverse(x);}};
|
||||
// template <class T> class converter<order::little, order::native, T> {public: void operator()(T&) BOOST_NOEXCEPT {/*no effect*/}};
|
||||
//# endif
|
||||
}
|
||||
|
||||
// compile-time generic byte-order convert in place
|
||||
|
@@ -492,38 +492,6 @@ namespace endian
|
||||
char m_value[n_bits/8];
|
||||
};
|
||||
|
||||
// // unaligned native endian specialization
|
||||
// template <typename T, std::size_t n_bits>
|
||||
// class endian< order::native, T, n_bits, align::no >
|
||||
// : cover_operators< endian< order::native, T, n_bits >, T >
|
||||
// {
|
||||
// BOOST_STATIC_ASSERT( (n_bits/8)*8 == n_bits );
|
||||
// public:
|
||||
// typedef T value_type;
|
||||
//# ifndef BOOST_ENDIAN_NO_CTORS
|
||||
// endian() BOOST_ENDIAN_DEFAULT_CONSTRUCT
|
||||
//# ifdef BOOST_BIG_ENDIAN
|
||||
// BOOST_ENDIAN_EXPLICIT_OPT endian(T val) BOOST_NOEXCEPT { detail::store_big_endian<T, n_bits/8>(m_value, val); }
|
||||
//# else
|
||||
// BOOST_ENDIAN_EXPLICIT_OPT endian(T val) BOOST_NOEXCEPT { detail::store_little_endian<T, n_bits/8>(m_value, val); }
|
||||
//# endif
|
||||
//# endif
|
||||
//# ifdef BOOST_BIG_ENDIAN
|
||||
// endian & operator=(T val) BOOST_NOEXCEPT
|
||||
// { detail::store_big_endian<T, n_bits/8>(m_value, val); return *this; }
|
||||
// operator T() const BOOST_NOEXCEPT
|
||||
// { return detail::load_big_endian<T, n_bits/8>(m_value); }
|
||||
//# else
|
||||
// endian & operator=(T val) BOOST_NOEXCEPT
|
||||
// { detail::store_little_endian<T, n_bits/8>(m_value, val); return *this; }
|
||||
// operator T() const BOOST_NOEXCEPT
|
||||
// { return detail::load_little_endian<T, n_bits/8>(m_value); }
|
||||
//# endif
|
||||
// const char* data() const BOOST_NOEXCEPT { return m_value; }
|
||||
// private:
|
||||
// char m_value[n_bits/8];
|
||||
// };
|
||||
|
||||
// align::yes specializations; only n_bits == 16/32/64 supported
|
||||
|
||||
// aligned big endian specialization
|
||||
|
Reference in New Issue
Block a user