summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities/optional/optional.hash
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2013-11-15 22:42:10 +0000
committerMarshall Clow <mclow.lists@gmail.com>2013-11-15 22:42:10 +0000
commitdfdac03c8fcd6165795bf8dbce3384ec442ee3d1 (patch)
treef8a767bbb9f4231c09711442de9c05b297b7a9ab /libcxx/test/utilities/optional/optional.hash
parent3f823e3af17a0192fc7da4b3d071815c72858a6b (diff)
downloadbcm5719-llvm-dfdac03c8fcd6165795bf8dbce3384ec442ee3d1.tar.gz
bcm5719-llvm-dfdac03c8fcd6165795bf8dbce3384ec442ee3d1.zip
Move <optional> into include/experimental, and into the std::experimental namespace, since it's not part of C++14, but of an upcoming TS
llvm-svn: 194867
Diffstat (limited to 'libcxx/test/utilities/optional/optional.hash')
-rw-r--r--libcxx/test/utilities/optional/optional.hash/hash.pass.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/libcxx/test/utilities/optional/optional.hash/hash.pass.cpp b/libcxx/test/utilities/optional/optional.hash/hash.pass.cpp
index 406632ae1fc..ca23d78c531 100644
--- a/libcxx/test/utilities/optional/optional.hash/hash.pass.cpp
+++ b/libcxx/test/utilities/optional/optional.hash/hash.pass.cpp
@@ -11,38 +11,37 @@
// template <class T> struct hash<optional<T>>;
-#include <optional>
+#include <experimental/optional>
#include <string>
#include <memory>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
-
-#endif // _LIBCPP_STD_VER > 11
int main()
{
#if _LIBCPP_STD_VER > 11
+ using std::experimental::optional;
+
{
typedef int T;
- std::optional<T> opt;
- assert(std::hash<std::optional<T>>{}(opt) == 0);
+ optional<T> opt;
+ assert(std::hash<optional<T>>{}(opt) == 0);
opt = 2;
- assert(std::hash<std::optional<T>>{}(opt) == std::hash<T>{}(*opt));
+ assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt));
}
{
typedef std::string T;
- std::optional<T> opt;
- assert(std::hash<std::optional<T>>{}(opt) == 0);
+ optional<T> opt;
+ assert(std::hash<optional<T>>{}(opt) == 0);
opt = std::string("123");
- assert(std::hash<std::optional<T>>{}(opt) == std::hash<T>{}(*opt));
+ assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt));
}
{
typedef std::unique_ptr<int> T;
- std::optional<T> opt;
- assert(std::hash<std::optional<T>>{}(opt) == 0);
+ optional<T> opt;
+ assert(std::hash<optional<T>>{}(opt) == 0);
opt = std::unique_ptr<int>(new int(3));
- assert(std::hash<std::optional<T>>{}(opt) == std::hash<T>{}(*opt));
+ assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt));
}
#endif // _LIBCPP_STD_VER > 11
}
OpenPOWER on IntegriCloud