Results 1 to 3 of 3
Thread: Practicing C++ Templates
-
2024-04-06, 12:07 AM (ISO 8601)
- Join Date
- Nov 2010
- Location
- California
- Gender
Practicing C++ Templates
I want to get better at C++ templates. I can do the basics:
Code:template<typename T> T& min(T& t1, T& t2) { return t1 < t2 ? t1 : t2; }
Does anyone know a good place to get practice? What I'd really love is something like leetcode, but focused on C++ templates instead of algorithms.
-
2024-05-03, 12:25 PM (ISO 8601)
- Join Date
- Aug 2010
Re: Practicing C++ Templates
What's your overall knowledge of c++?
"Gosh 2D8HP, you are so very correct (and also good looking)"
-
2024-05-05, 01:11 AM (ISO 8601)
- Join Date
- Nov 2010
- Location
- California
- Gender
Re: Practicing C++ Templates
Very strong -- I've been using C++ professionally for over two decades. I can tell you about std::optional and string_view, explain the one-definition rule, and know what std::move actually does. I can write an overload and an override. I've crashed std::sort and I've signal-handled a segfault. I can even fake my way through an explanation of memory_order_relaxed vs. memory_order_acquire/memory_order_release vs. memory_order_seq_cst.
But I haven't had much chance to play with templates after the C++11 improvements, so I wanted to work on that.