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) {
* Parsing strings to numeric types.
*/
template <typename Tgt>
FOLLY_WARN_UNUSED_RESULT inline typename std::enable_if<
FOLLY_NODISCARD inline typename std::enable_if<
std::is_arithmetic<Tgt>::value,
Expected<StringPiece, ConversionCode>>::type
parseTo(StringPiece src, Tgt& out) {
......@@ -1372,7 +1372,7 @@ typename std::enable_if<detail::IsArithToArith<Tgt, Src>::value, Tgt>::type to(
* }
******************************************************************************/
template <class T>
FOLLY_WARN_UNUSED_RESULT typename std::enable_if<
FOLLY_NODISCARD typename std::enable_if<
std::is_enum<T>::value,
Expected<StringPiece, ConversionCode>>::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<StringPiece, ConversionCode> parseTo(
StringPiece in,
StringPiece& out) noexcept {
......@@ -1390,7 +1390,7 @@ inline Expected<StringPiece, ConversionCode> parseTo(
return StringPiece{in.end(), in.end()};
}
FOLLY_WARN_UNUSED_RESULT
FOLLY_NODISCARD
inline Expected<StringPiece, ConversionCode> parseTo(
StringPiece in,
std::string& out) {
......@@ -1399,7 +1399,7 @@ inline Expected<StringPiece, ConversionCode> parseTo(
return StringPiece{in.end(), in.end()};
}
FOLLY_WARN_UNUSED_RESULT
FOLLY_NODISCARD
inline Expected<StringPiece, ConversionCode> parseTo(
StringPiece in,
fbstring& out) {
......
......@@ -85,7 +85,6 @@ constexpr bool kHasUnalignedAccess = false;
#define FOLLY_NODISCARD
#endif
#endif
#define FOLLY_WARN_UNUSED_RESULT FOLLY_NODISCARD
// target
#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