Remove FMT_USE_RVALUE_REFERENCES

This commit is contained in:
Victor Zverovich 2017-09-04 13:52:29 -07:00
parent 7413239f49
commit 1cade7ef4d

View File

@ -128,22 +128,6 @@
# define FMT_NORETURN # define FMT_NORETURN
#endif #endif
#ifndef FMT_USE_RVALUE_REFERENCES
// Don't use rvalue references when compiling with clang and an old libstdc++
// as the latter doesn't provide std::move.
# if defined(FMT_GNUC_LIBSTD_VERSION) && FMT_GNUC_LIBSTD_VERSION <= 402
# define FMT_USE_RVALUE_REFERENCES 0
# else
# define FMT_USE_RVALUE_REFERENCES \
(FMT_HAS_FEATURE(cxx_rvalue_references) || \
FMT_GCC_VERSION >= 403 || FMT_MSC_VER >= 1600)
# endif
#endif
#if FMT_USE_RVALUE_REFERENCES
# include <utility> // for std::move
#endif
// Check if exceptions are disabled. // Check if exceptions are disabled.
#if defined(__GNUC__) && !defined(__EXCEPTIONS) #if defined(__GNUC__) && !defined(__EXCEPTIONS)
# define FMT_EXCEPTIONS 0 # define FMT_EXCEPTIONS 0
@ -205,8 +189,7 @@
// makes the fmt::literals implementation easier. However, an explicit check // makes the fmt::literals implementation easier. However, an explicit check
// for variadic templates is added here just in case. // for variadic templates is added here just in case.
// For Intel's compiler both it and the system gcc/msc must support UDLs. // For Intel's compiler both it and the system gcc/msc must support UDLs.
# if FMT_USE_RVALUE_REFERENCES && \ # if (FMT_HAS_FEATURE(cxx_user_literals) || \
(FMT_HAS_FEATURE(cxx_user_literals) || \
FMT_GCC_VERSION >= 407 || FMT_MSC_VER >= 1900) && \ FMT_GCC_VERSION >= 407 || FMT_MSC_VER >= 1900) && \
(!defined(FMT_ICC_VERSION) || FMT_ICC_VERSION >= 1500) (!defined(FMT_ICC_VERSION) || FMT_ICC_VERSION >= 1500)
# define FMT_USE_USER_DEFINED_LITERALS 1 # define FMT_USE_USER_DEFINED_LITERALS 1
@ -352,10 +335,6 @@ class numeric_limits<fmt::internal::dummy_int> :
namespace fmt { namespace fmt {
#if FMT_USE_RVALUE_REFERENCES
using std::move;
#endif
template <typename Char> template <typename Char>
class basic_writer; class basic_writer;
@ -646,7 +625,6 @@ class basic_memory_buffer : private Allocator, public basic_buffer<T> {
} }
~basic_memory_buffer() { deallocate(); } ~basic_memory_buffer() { deallocate(); }
#if FMT_USE_RVALUE_REFERENCES
private: private:
// Move data from other to this buffer. // Move data from other to this buffer.
void move(basic_memory_buffer &other) { void move(basic_memory_buffer &other) {
@ -689,7 +667,6 @@ class basic_memory_buffer : private Allocator, public basic_buffer<T> {
move(other); move(other);
return *this; return *this;
} }
#endif
// Returns a copy of the allocator associated with this buffer. // Returns a copy of the allocator associated with this buffer.
Allocator get_allocator() const { return *this; } Allocator get_allocator() const { return *this; }