From 026f4c6024ced642e7fff1949a38657b40a92c45 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 26 Mar 2021 14:41:58 +0100 Subject: SL-14999 - more cpp features tests --- indra/newview/tests/cppfeatures_test.cpp | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/indra/newview/tests/cppfeatures_test.cpp b/indra/newview/tests/cppfeatures_test.cpp index bfaa83140d..9f052c11c4 100644 --- a/indra/newview/tests/cppfeatures_test.cpp +++ b/indra/newview/tests/cppfeatures_test.cpp @@ -335,6 +335,49 @@ void cpp_features_test_object_t::test<10>() static_assert(ce_factorial(6)==720, "bad factorial"); // OK } +// type aliases +// +// https://en.cppreference.com/w/cpp/language/type_alias +// +// You can use the "using" statement to create simpler templates that +// are aliases for more complex ones. "Template typedef" + +// This makes stringmap an alias for std::map +template +using stringmap = std::map; + +template<> template<> +void cpp_features_test_object_t::test<11>() +{ + stringmap name_counts{ {"alice", 3}, {"bob", 2} }; + ensure("type alias", name_counts["bob"]==2); +} + + +// nullptr + +// enums + +// std::unique_ptr and make_unique + +// std::shared_ptr and make_shared + +// lambdas + +// perfect forwarding + +// variadic templates + +// std::thread + +// std::mutex + +// thread_local + +// rvalue reference && + +// move semantics +// std::move } // namespace tut -- cgit v1.2.3