forked from boostorg/utility
Added a workaround for gcc 4.6 in C++11 mode as it can't seem to handle defaulted functions with noexcept specifier. The problem was discovered with autotests.
This commit is contained in:
@ -27,6 +27,11 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || (defined(BOOST_GCC) && ((BOOST_GCC+0) / 100) <= 406)
|
||||||
|
// GCC 4.6 cannot handle a defaulted function with noexcept specifier
|
||||||
|
#define BOOST_STRING_REF_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
@ -63,14 +68,14 @@ namespace boost {
|
|||||||
// by defaulting these functions, basic_string_ref becomes
|
// by defaulting these functions, basic_string_ref becomes
|
||||||
// trivially copy/move constructible.
|
// trivially copy/move constructible.
|
||||||
BOOST_CONSTEXPR basic_string_ref (const basic_string_ref &rhs) BOOST_NOEXCEPT
|
BOOST_CONSTEXPR basic_string_ref (const basic_string_ref &rhs) BOOST_NOEXCEPT
|
||||||
#ifndef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
|
#ifndef BOOST_STRING_REF_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS
|
||||||
= default;
|
= default;
|
||||||
#else
|
#else
|
||||||
: ptr_(rhs.ptr_), len_(rhs.len_) {}
|
: ptr_(rhs.ptr_), len_(rhs.len_) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
basic_string_ref& operator=(const basic_string_ref &rhs) BOOST_NOEXCEPT
|
basic_string_ref& operator=(const basic_string_ref &rhs) BOOST_NOEXCEPT
|
||||||
#ifndef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
|
#ifndef BOOST_STRING_REF_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS
|
||||||
= default;
|
= default;
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
|
@ -30,6 +30,11 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || (defined(BOOST_GCC) && ((BOOST_GCC+0) / 100) <= 406)
|
||||||
|
// GCC 4.6 cannot handle a defaulted function with noexcept specifier
|
||||||
|
#define BOOST_STRING_VIEW_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
@ -68,14 +73,14 @@ namespace boost {
|
|||||||
// by defaulting these functions, basic_string_ref becomes
|
// by defaulting these functions, basic_string_ref becomes
|
||||||
// trivially copy/move constructible.
|
// trivially copy/move constructible.
|
||||||
BOOST_CONSTEXPR basic_string_view(const basic_string_view &rhs) BOOST_NOEXCEPT
|
BOOST_CONSTEXPR basic_string_view(const basic_string_view &rhs) BOOST_NOEXCEPT
|
||||||
#ifndef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
|
#ifndef BOOST_STRING_VIEW_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS
|
||||||
= default;
|
= default;
|
||||||
#else
|
#else
|
||||||
: ptr_(rhs.ptr_), len_(rhs.len_) {}
|
: ptr_(rhs.ptr_), len_(rhs.len_) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
basic_string_view& operator=(const basic_string_view &rhs) BOOST_NOEXCEPT
|
basic_string_view& operator=(const basic_string_view &rhs) BOOST_NOEXCEPT
|
||||||
#ifndef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
|
#ifndef BOOST_STRING_VIEW_NO_CXX11_DEFAULTED_NOEXCEPT_FUNCTIONS
|
||||||
= default;
|
= default;
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user