Commit 713e4298 authored by Eric Niebler's avatar Eric Niebler Committed by Facebook Github Bot

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
parent e1d2ddd5
...@@ -1165,7 +1165,7 @@ to(const char* b, const char* e) { ...@@ -1165,7 +1165,7 @@ to(const char* b, const char* e) {
* Parsing strings to numeric types. * Parsing strings to numeric types.
*/ */
template <typename Tgt> template <typename Tgt>
FOLLY_WARN_UNUSED_RESULT inline typename std::enable_if< FOLLY_NODISCARD inline typename std::enable_if<
std::is_arithmetic<Tgt>::value, std::is_arithmetic<Tgt>::value,
Expected<StringPiece, ConversionCode>>::type Expected<StringPiece, ConversionCode>>::type
parseTo(StringPiece src, Tgt& out) { parseTo(StringPiece src, Tgt& out) {
...@@ -1372,7 +1372,7 @@ typename std::enable_if<detail::IsArithToArith<Tgt, Src>::value, Tgt>::type to( ...@@ -1372,7 +1372,7 @@ typename std::enable_if<detail::IsArithToArith<Tgt, Src>::value, Tgt>::type to(
* } * }
******************************************************************************/ ******************************************************************************/
template <class T> template <class T>
FOLLY_WARN_UNUSED_RESULT typename std::enable_if< FOLLY_NODISCARD typename std::enable_if<
std::is_enum<T>::value, std::is_enum<T>::value,
Expected<StringPiece, ConversionCode>>::type Expected<StringPiece, ConversionCode>>::type
parseTo(StringPiece in, T& out) noexcept { parseTo(StringPiece in, T& out) noexcept {
...@@ -1382,7 +1382,7 @@ parseTo(StringPiece in, T& out) noexcept { ...@@ -1382,7 +1382,7 @@ parseTo(StringPiece in, T& out) noexcept {
return restOrError; return restOrError;
} }
FOLLY_WARN_UNUSED_RESULT FOLLY_NODISCARD
inline Expected<StringPiece, ConversionCode> parseTo( inline Expected<StringPiece, ConversionCode> parseTo(
StringPiece in, StringPiece in,
StringPiece& out) noexcept { StringPiece& out) noexcept {
...@@ -1390,7 +1390,7 @@ inline Expected<StringPiece, ConversionCode> parseTo( ...@@ -1390,7 +1390,7 @@ inline Expected<StringPiece, ConversionCode> parseTo(
return StringPiece{in.end(), in.end()}; return StringPiece{in.end(), in.end()};
} }
FOLLY_WARN_UNUSED_RESULT FOLLY_NODISCARD
inline Expected<StringPiece, ConversionCode> parseTo( inline Expected<StringPiece, ConversionCode> parseTo(
StringPiece in, StringPiece in,
std::string& out) { std::string& out) {
...@@ -1399,7 +1399,7 @@ inline Expected<StringPiece, ConversionCode> parseTo( ...@@ -1399,7 +1399,7 @@ inline Expected<StringPiece, ConversionCode> parseTo(
return StringPiece{in.end(), in.end()}; return StringPiece{in.end(), in.end()};
} }
FOLLY_WARN_UNUSED_RESULT FOLLY_NODISCARD
inline Expected<StringPiece, ConversionCode> parseTo( inline Expected<StringPiece, ConversionCode> parseTo(
StringPiece in, StringPiece in,
fbstring& out) { fbstring& out) {
......
...@@ -85,7 +85,6 @@ constexpr bool kHasUnalignedAccess = false; ...@@ -85,7 +85,6 @@ constexpr bool kHasUnalignedAccess = false;
#define FOLLY_NODISCARD #define FOLLY_NODISCARD
#endif #endif
#endif #endif
#define FOLLY_WARN_UNUSED_RESULT FOLLY_NODISCARD
// target // target
#ifdef _MSC_VER #ifdef _MSC_VER
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment