Commit 6e707da9 authored by Louis Brandy's avatar Louis Brandy Committed by Facebook Github Bot

fix OptionalTest for gcc7

Summary: This is horrifying. `std::make_optional` is visible w/o `using` anything, making the use of `make_optional` here ambiguous.

Reviewed By: yfeldblum, elsteveogrande

Differential Revision: D8775609

fbshipit-source-id: 4f1162958909dfab603d2c61473155555a05e9d2
parent 4548dadb
...@@ -573,7 +573,7 @@ TEST(Optional, Pointee) { ...@@ -573,7 +573,7 @@ TEST(Optional, Pointee) {
TEST(Optional, MakeOptional) { TEST(Optional, MakeOptional) {
// const L-value version // const L-value version
const std::string s("abc"); const std::string s("abc");
auto optStr = make_optional(s); auto optStr = folly::make_optional(s);
ASSERT_TRUE(optStr.hasValue()); ASSERT_TRUE(optStr.hasValue());
EXPECT_EQ(*optStr, "abc"); EXPECT_EQ(*optStr, "abc");
*optStr = "cde"; *optStr = "cde";
...@@ -582,7 +582,7 @@ TEST(Optional, MakeOptional) { ...@@ -582,7 +582,7 @@ TEST(Optional, MakeOptional) {
// L-value version // L-value version
std::string s2("abc"); std::string s2("abc");
auto optStr2 = make_optional(s2); auto optStr2 = folly::make_optional(s2);
ASSERT_TRUE(optStr2.hasValue()); ASSERT_TRUE(optStr2.hasValue());
EXPECT_EQ(*optStr2, "abc"); EXPECT_EQ(*optStr2, "abc");
*optStr2 = "cde"; *optStr2 = "cde";
...@@ -591,7 +591,7 @@ TEST(Optional, MakeOptional) { ...@@ -591,7 +591,7 @@ TEST(Optional, MakeOptional) {
// L-value reference version // L-value reference version
std::string& s3(s2); std::string& s3(s2);
auto optStr3 = make_optional(s3); auto optStr3 = folly::make_optional(s3);
ASSERT_TRUE(optStr3.hasValue()); ASSERT_TRUE(optStr3.hasValue());
EXPECT_EQ(*optStr3, "abc"); EXPECT_EQ(*optStr3, "abc");
*optStr3 = "cde"; *optStr3 = "cde";
...@@ -599,7 +599,7 @@ TEST(Optional, MakeOptional) { ...@@ -599,7 +599,7 @@ TEST(Optional, MakeOptional) {
// R-value ref version // R-value ref version
unique_ptr<int> pInt(new int(3)); unique_ptr<int> pInt(new int(3));
auto optIntPtr = make_optional(std::move(pInt)); auto optIntPtr = folly::make_optional(std::move(pInt));
EXPECT_TRUE(pInt.get() == nullptr); EXPECT_TRUE(pInt.get() == nullptr);
ASSERT_TRUE(optIntPtr.hasValue()); ASSERT_TRUE(optIntPtr.hasValue());
EXPECT_EQ(**optIntPtr, 3); EXPECT_EQ(**optIntPtr, 3);
......
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