From 67c27efd61f1c44fd02e7b3a08f5f0d43485d16b Mon Sep 17 00:00:00 2001 From: neargye Date: Wed, 2 Oct 2019 15:09:57 +0500 Subject: [PATCH] add nodiscard --- include/nameof.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/nameof.hpp b/include/nameof.hpp index ceaec05..a59bfa0 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -146,18 +146,18 @@ struct [[nodiscard]] static_string final { }; template <> -struct static_string<0> final { +struct [[nodiscard]] static_string<0> final { constexpr static_string(std::string_view) noexcept {} - constexpr const char* data() const noexcept { return nullptr; } + [[nodiscard]] constexpr const char* data() const noexcept { return nullptr; } - constexpr std::size_t size() const noexcept { return 0; } + [[nodiscard]] constexpr std::size_t size() const noexcept { return 0; } [[nodiscard]] constexpr int compare(std::string_view str) const noexcept { return std::string_view{}.compare(str); } - constexpr operator std::string_view() const noexcept { return {}; } + [[nodiscard]] constexpr operator std::string_view() const noexcept { return {}; } }; template