From: Eric Niebler Date: Thu, 25 May 2017 03:29:37 +0000 (-0700) Subject: Replace FOLLY_WARN_UNUSED_RESULT with FOLLY_NODISCARD everywhere X-Git-Tag: v2017.05.29.00~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=713e429835eb97113f52baa77f59a7787338c32a;p=folly.git Replace FOLLY_WARN_UNUSED_RESULT with FOLLY_NODISCARD everywhere Summary: `[[nodiscard]]` is the future. Let's start now. Reviewed By: yfeldblum Differential Revision: D5108297 fbshipit-source-id: c98f44af9e282616af92f9171516b6ea18e68c6d --- diff --git a/folly/Conv.h b/folly/Conv.h index 25cb26eb..22cc8ac4 100644 --- a/folly/Conv.h +++ b/folly/Conv.h @@ -1165,7 +1165,7 @@ to(const char* b, const char* e) { * Parsing strings to numeric types. */ template -FOLLY_WARN_UNUSED_RESULT inline typename std::enable_if< +FOLLY_NODISCARD inline typename std::enable_if< std::is_arithmetic::value, Expected>::type parseTo(StringPiece src, Tgt& out) { @@ -1372,7 +1372,7 @@ typename std::enable_if::value, Tgt>::type to( * } ******************************************************************************/ template -FOLLY_WARN_UNUSED_RESULT typename std::enable_if< +FOLLY_NODISCARD typename std::enable_if< std::is_enum::value, Expected>::type parseTo(StringPiece in, T& out) noexcept { @@ -1382,7 +1382,7 @@ parseTo(StringPiece in, T& out) noexcept { return restOrError; } -FOLLY_WARN_UNUSED_RESULT +FOLLY_NODISCARD inline Expected parseTo( StringPiece in, StringPiece& out) noexcept { @@ -1390,7 +1390,7 @@ inline Expected parseTo( return StringPiece{in.end(), in.end()}; } -FOLLY_WARN_UNUSED_RESULT +FOLLY_NODISCARD inline Expected parseTo( StringPiece in, std::string& out) { @@ -1399,7 +1399,7 @@ inline Expected parseTo( return StringPiece{in.end(), in.end()}; } -FOLLY_WARN_UNUSED_RESULT +FOLLY_NODISCARD inline Expected parseTo( StringPiece in, fbstring& out) { diff --git a/folly/Portability.h b/folly/Portability.h index 49d48f07..7b822cda 100644 --- a/folly/Portability.h +++ b/folly/Portability.h @@ -85,7 +85,6 @@ constexpr bool kHasUnalignedAccess = false; #define FOLLY_NODISCARD #endif #endif -#define FOLLY_WARN_UNUSED_RESULT FOLLY_NODISCARD // target #ifdef _MSC_VER