14m:33s Arthur says function templates can't be partially specialized, but it appears what he is demonstrating here is actually function overloading. (Not that this takes away from the following implementation: tag dispatch is the right solution here.)
Too complicated to be useful. Imagine how much time we need to code review and debug. Subtle differences can cause dramatic changes. Still this is a very helpful and informative talk. Most C++ books just includes a very brief intro to template programming, as if it is so easy to use. In fact it’s not.
Same old song, I'm sorry to say. It doesn't mesh well with the compilation model. I mean, come on... header only, or write the declaration, declare the specialization, then specialize in the translation unit? Isn't that at best a really verbose work-around because of the compilation model? The syntax is too verbose. Put simply, it's a shame people discovered all these admittedly useful techniques and made them "legacy" before someone had time to redesign templates and produce a moderately palatable language feature. There's no doubt in my mind that a modern language needs a reasonable way to process types, but this can't be the right way to do it. The cognitive load of actually using templates is too high for an average programmer such as myself. The complexity is so staggering I can't even recall what this supposed tool is supposed to help me solve. It's an interesting puzzle, the more advanced C++ stuff, and that makes it fun in its own right, but not very productive. Maybe I'll look into it when I'm retired and have infinite time to get lost in the details. This is a great talk, though.
You should think of the template meta-programming machinery as a functional sub-language within the C++ itself. If you can solve a problem by applying a functional approach, odds are that the same solution can be applied as C++ templates too, where you represent actual values of the problem domain as the types themselves, while the "code" is executed by the compiler itself... weird-ugly-syntax notwithstanding :) Also the other part of the problem you mentioned, header only etc... it should be different (and solved, maybe?) when they release C++ modules at last.
Need to watch this at least 3 times before it sinks in !
The first time I listened to it, I fell asleep 😂 let's go for the next step
Real useful stuff. Thank you very much.
14m:33s Arthur says function templates can't be partially specialized, but it appears what he is demonstrating here is actually function overloading. (Not that this takes away from the following implementation: tag dispatch is the right solution here.)
very useful presentation and a lot of useful techniques.
38:20 variadic templates
can't get this exaplest to work with clang3.9 ;]
Well structured presentation, one step at a time. However, especially the second part is a little rushed through, which makes it hard to follow.
Good stuff, but showing the difference of template instantiation and initialization was horrifically confusing.
Too complicated to be useful. Imagine how much time we need to code review and debug. Subtle differences can cause dramatic changes. Still this is a very helpful and informative talk. Most C++ books just includes a very brief intro to template programming, as if it is so easy to use. In fact it’s not.
It seems you are new to c++ haha
*Awesome! Thank you!*
Damn. I was looking for Scott Meyers or this guy to talk about CRTP and he just skipped the pattern...
Great Talk!
You need to book more time dude! Good stuff though.
It is horribly complex.
Dont say "call it" when all the phones in the room are listening you.. I wonder who had "it" in the contacts?
Templates still look like black magic to me :/.
Sigh.... No. No, no, no.
What's wrong?
Same old song, I'm sorry to say.
It doesn't mesh well with the compilation model. I mean, come on... header only, or write the declaration, declare the specialization, then specialize in the translation unit? Isn't that at best a really verbose work-around because of the compilation model?
The syntax is too verbose. Put simply, it's a shame people discovered all these admittedly useful techniques and made them "legacy" before someone had time to redesign templates and produce a moderately palatable language feature. There's no doubt in my mind that a modern language needs a reasonable way to process types, but this can't be the right way to do it.
The cognitive load of actually using templates is too high for an average programmer such as myself. The complexity is so staggering I can't even recall what this supposed tool is supposed to help me solve.
It's an interesting puzzle, the more advanced C++ stuff, and that makes it fun in its own right, but not very productive. Maybe I'll look into it when I'm retired and have infinite time to get lost in the details.
This is a great talk, though.
What if we were able to abandon all the legacy and start anew; what would such a template system look like?
You should think of the template meta-programming machinery as a functional sub-language within the C++ itself.
If you can solve a problem by applying a functional approach, odds are that the same solution can be applied as C++ templates too, where you represent actual values of the problem domain as the types themselves, while the "code" is executed by the compiler itself... weird-ugly-syntax notwithstanding :)
Also the other part of the problem you mentioned, header only etc... it should be different (and solved, maybe?) when they release C++ modules at last.