Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added MSVC checking for support for string_view. #578

Merged
merged 1 commit into from
Oct 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
# define FMT_HAS_INCLUDE(x) 0
#endif

#if FMT_HAS_INCLUDE(<string_view>) && __cplusplus > 201402L
#if (FMT_HAS_INCLUDE(<string_view>) && __cplusplus > 201402L) || \
(defined(_MSVC_LANG) && _MSVC_LANG > 201402L && _MSC_VER >= 1910)
# include <string_view>
# define FMT_HAS_STRING_VIEW 1
#else
Expand Down Expand Up @@ -658,7 +659,7 @@ class FormatError : public std::runtime_error {
explicit FormatError(CStringRef message)
: std::runtime_error(message.c_str()) {}
FormatError(const FormatError &ferr) : std::runtime_error(ferr) {}
FMT_API ~FormatError() FMT_DTOR_NOEXCEPT;
FMT_API ~FormatError() FMT_DTOR_NOEXCEPT FMT_OVERRIDE;
};

namespace internal {
Expand Down Expand Up @@ -803,7 +804,7 @@ class MemoryBuffer : private Allocator, public Buffer<T> {
public:
explicit MemoryBuffer(const Allocator &alloc = Allocator())
: Allocator(alloc), Buffer<T>(data_, SIZE) {}
~MemoryBuffer() { deallocate(); }
~MemoryBuffer() FMT_OVERRIDE { deallocate(); }

#if FMT_USE_RVALUE_REFERENCES
private:
Expand Down Expand Up @@ -1505,7 +1506,7 @@ class RuntimeError : public std::runtime_error {
protected:
RuntimeError() : std::runtime_error("") {}
RuntimeError(const RuntimeError &rerr) : std::runtime_error(rerr) {}
FMT_API ~RuntimeError() FMT_DTOR_NOEXCEPT;
FMT_API ~RuntimeError() FMT_DTOR_NOEXCEPT FMT_OVERRIDE;
};

template <typename Char>
Expand Down Expand Up @@ -2514,7 +2515,7 @@ class SystemError : public internal::RuntimeError {
FMT_DEFAULTED_COPY_CTOR(SystemError)
FMT_VARIADIC_CTOR(SystemError, init, int, CStringRef)

FMT_API ~SystemError() FMT_DTOR_NOEXCEPT;
FMT_API ~SystemError() FMT_DTOR_NOEXCEPT FMT_OVERRIDE;

int error_code() const { return error_code_; }
};
Expand Down