forked from boostorg/conversion
Merge from trunk
* Fixes #7799 (optimizations with std::array were not used) * Fixes #7831 (documentation update) [SVN r82224]
This commit is contained in:
1 parent
dbda7689e0
commit
16890bf041
4 files changed
+58
-45
No files matched your search
@@ -151,7 +151,7 @@ namespace boost
|
||||
#include <cmath>
|
||||
#include <istream>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_ARRAY) && defined(BOOST_HAS_TR1_ARRAY)
|
||||
#ifndef BOOST_NO_CXX11_HDR_ARRAY
|
||||
#include <array>
|
||||
#endif
|
||||
|
||||
@@ -294,7 +294,7 @@ namespace boost {
|
||||
boost::detail::deduce_character_type_later< boost::array< const Char, N > >
|
||||
> {};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_ARRAY) && defined(BOOST_HAS_TR1_ARRAY)
|
||||
#ifndef BOOST_NO_CXX11_HDR_ARRAY
|
||||
template < typename Char, std::size_t N >
|
||||
struct stream_char_common< std::array<Char, N > >: public boost::mpl::if_c<
|
||||
boost::detail::is_char_or_wchar< Char >::value,
|
||||
@@ -308,7 +308,7 @@ namespace boost {
|
||||
Char,
|
||||
boost::detail::deduce_character_type_later< std::array< const Char, N > >
|
||||
> {};
|
||||
#endif // !defined(BOOST_NO_CXX11_HDR_ARRAY) && defined(BOOST_HAS_TR1_ARRAY)
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_LCAST_NO_WCHAR_T) && defined(BOOST_NO_INTRINSIC_WCHAR_T)
|
||||
template <>
|
||||
@@ -1768,10 +1768,13 @@ namespace boost {
|
||||
bool operator<<(boost::array<const signed char, N> const& input) BOOST_NOEXCEPT
|
||||
{ return ((*this) << reinterpret_cast<boost::array<const char, N> const& >(input)); }
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_ARRAY) && defined(BOOST_HAS_TR1_ARRAY)
|
||||
#ifndef BOOST_NO_CXX11_HDR_ARRAY
|
||||
template <std::size_t N>
|
||||
bool operator<<(std::array<CharT, N> const& input) BOOST_NOEXCEPT
|
||||
{ return shl_char_array_limited(input.begin(), N); }
|
||||
{
|
||||
if (input.size()) return shl_char_array_limited(&input[0], N);
|
||||
else return true;
|
||||
}
|
||||
|
||||
template <std::size_t N>
|
||||
bool operator<<(std::array<unsigned char, N> const& input) BOOST_NOEXCEPT
|
||||
@@ -1783,7 +1786,10 @@ namespace boost {
|
||||
|
||||
template <std::size_t N>
|
||||
bool operator<<(std::array<const CharT, N> const& input) BOOST_NOEXCEPT
|
||||
{ return shl_char_array_limited(input.begin(), N); }
|
||||
{
|
||||
if (input.size()) return shl_char_array_limited(&input[0], N);
|
||||
else return true;
|
||||
}
|
||||
|
||||
template <std::size_t N>
|
||||
bool operator<<(std::array<const unsigned char, N> const& input) BOOST_NOEXCEPT
|
||||
@@ -1792,7 +1798,7 @@ namespace boost {
|
||||
template <std::size_t N>
|
||||
bool operator<<(std::array<const signed char, N> const& input) BOOST_NOEXCEPT
|
||||
{ return ((*this) << reinterpret_cast<boost::array<const char, N> const& >(input)); }
|
||||
#endif // !defined(BOOST_NO_CXX11_HDR_ARRAY) && defined(BOOST_HAS_TR1_ARRAY)
|
||||
#endif
|
||||
|
||||
template <class InStreamable>
|
||||
bool operator<<(const InStreamable& input) { return shl_input_streamable(input); }
|
||||
@@ -1984,8 +1990,8 @@ namespace boost {
|
||||
return false;
|
||||
}
|
||||
|
||||
memcpy(output.begin(), start, size * sizeof(CharT));
|
||||
*(output.begin() + size) = Traits::to_char_type(0);
|
||||
memcpy(&output[0], start, size * sizeof(CharT));
|
||||
output[size] = Traits::to_char_type(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2009,7 +2015,7 @@ namespace boost {
|
||||
return ((*this) >> reinterpret_cast<boost::array<char, N>& >(output));
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_ARRAY) && defined(BOOST_HAS_TR1_ARRAY)
|
||||
#ifndef BOOST_NO_CXX11_HDR_ARRAY
|
||||
template <std::size_t N>
|
||||
bool operator>>(std::array<CharT, N>& output) BOOST_NOEXCEPT
|
||||
{
|
||||
@@ -2023,11 +2029,11 @@ namespace boost {
|
||||
}
|
||||
|
||||
template <std::size_t N>
|
||||
bool operator>>(std::array<signed char, N>& in)
|
||||
bool operator>>(std::array<signed char, N>& output)
|
||||
{
|
||||
return ((*this) >> reinterpret_cast<std::array<char, N>& >(output));
|
||||
}
|
||||
#endif // !defined(BOOST_NO_CXX11_HDR_ARRAY) && defined(BOOST_HAS_TR1_ARRAY)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user