Skip to content

Commit

Permalink
add nodiscard
Browse files Browse the repository at this point in the history
  • Loading branch information
Neargye committed Oct 2, 2019
1 parent 47fa9b5 commit 67c27ef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/nameof.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <std::size_t N>
Expand Down

0 comments on commit 67c27ef

Please sign in to comment.