diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2021-03-26 14:41:58 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2021-03-26 14:41:58 +0100 |
commit | 026f4c6024ced642e7fff1949a38657b40a92c45 (patch) | |
tree | dc0eb9d520c8c44407b68bb10873f8615ca494ec | |
parent | 41a10cceb45f88d3ab433aa129eafd2ffa40256d (diff) |
SL-14999 - more cpp features tests
-rw-r--r-- | indra/newview/tests/cppfeatures_test.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
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<T> an alias for std::map<std::string, T> +template<typename T> +using stringmap = std::map<std::string, T>; + +template<> template<> +void cpp_features_test_object_t::test<11>() +{ + stringmap<S32> 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 |