cmake: build as many source files as possible
[folly.git] / folly / test / DiscriminatedPtrTest.cpp
index fafd6fa9589bd4cd20758174a6d3a89dd672fac0..932bb57ba6829ed8b9edd53c006131c4fde867d6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2011-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -86,6 +86,9 @@ TEST(DiscriminatedPtr, Apply) {
   p.set(&foo);
   EXPECT_EQ("Foo", p.apply(Visitor()));
   EXPECT_EQ("const Foo", static_cast<const Ptr&>(p).apply(Visitor()));
+  EXPECT_EQ("Foo", apply_visitor(Visitor(), p));
+  EXPECT_EQ("const Foo", apply_visitor(Visitor(), static_cast<const Ptr&>(p)));
+  EXPECT_EQ("Foo", apply_visitor(Visitor(), std::move(p)));
 
   p.clear();
   EXPECT_THROW({p.apply(Visitor());}, std::invalid_argument);