The fact that types "overrule" type deduction is something I wish I had learned the first time I heard about templates
@JobinAugustine Жыл бұрын
Great presentation and content. I am not a C++ programmer by profession. But I learned so much from this. Thanks a lot.
@lisekSL2 жыл бұрын
51:30 UPDATE: c++17 standard added class template deduction types. I've checked, it works. Enjoy folks ;)
@RedRumIzzy8 жыл бұрын
Great material and brilliant presenter! Really enjoyed the talk.
@Knuckler6 жыл бұрын
34:21 "I'm going to assume some knowledge of lvalues and rvalues... it's been five years, people." This speaks to the ridiculousness of Rvalue References and move operations than anything else.
@IllIlIIllIlIl6 жыл бұрын
I don't see what makes rvalue refs ridiculous. People haven't learned it yet because it is a (somewhat) complicated subject and a lot of people think they don't really need to understand it, which is not true since if you're programming in C++ you obviously care about performance which move semantics is all about, as well as allowing flexibility when copy constructors are deleted, for example.
@isodoubIet5 жыл бұрын
@@IllIlIIllIlIl Value categories aren't ridiculous. What's ridiculous is that said categories have to be defined on a case by case basis, so that either you get some imprecise intuition that's "good enough" for most cases (as the vast majority does), or you memorize all the rules, in which case I would encourage you to stay away from sharp objects because you're utterly mad. Surely this is just the kind of situation that merits the adjective "ridiculous". I'm not saying I have a better solution, but the language really is too complicated for its own good in this area.
@YuTe37128 жыл бұрын
Oh wow, thank you for fixing the title (bottom right)! Wasn't expecting a reupload and got excited thinking it was part 2. :')
@IllumTheMessage8 жыл бұрын
Nice description of why templates are useful. Thanks for the talk.
@AtomkeySinclair3 жыл бұрын
Worth it for PRETTY_FUNCTION explanation. Neato.
@playerguy23 жыл бұрын
1:07 ..wait, that's good, right? We write templates, sometimes for performance reasons. If not much time is spent doing meaningful work, then the this goal has been achieved.
@dans.54186 жыл бұрын
Not only a good content but an excellent presentation too. Thanks!
@wpavada32478 жыл бұрын
This would be much more interesting if pointer parameters to the function would be type deducted as well. In that case parameter passed can be both const type or const pointer.
@DevinSamarin7 жыл бұрын
Part 2: kzbin.info/www/bejne/jHrdZ6t4q9yMmpo
@seditt51465 жыл бұрын
Is someone able to explain the is_void to me. I must have missed something because I do not understand how making T void has any bearing on the output here.
awesome talk. and whoever contributes to the subtitle, a great job.
@Slicc123458 жыл бұрын
Where can i find the second Part :/?
@dresnyd7 жыл бұрын
Should be in the right (PC) list as recommended videos that people watched after this. Among the first videos. Probably was too recently uploaded for YT to realize that at the time you watched this video.
@andersknatten6 жыл бұрын
kzbin.info/www/bejne/jHrdZ6t4q9yMmpo
@allopeth5 жыл бұрын
Arthur you are f.... awesome!!!!!
@TarunSingh-je9my5 жыл бұрын
Nice explanation.I have below doubt on iterator Why we need to provide specialization in iterator template void process(Iterator begin, Iterator end) { for (; itr != end; ++itr) { process(*itr); } } why i can't write void process(Iterator begin, Iterator end) { for (; itr != end; ++itr) { process(*itr); } } please explain
@yotty975 жыл бұрын
Tarun Singh Iterator isn't a recognized type by itself, and there are different kinds of iterators based on type, so if yo wanted to specify a type there (without templates) you would be limiting the function to working on only one kind of interator
@victornoagbodji8 жыл бұрын
where is part 2?
@andersknatten6 жыл бұрын
kzbin.info/www/bejne/jHrdZ6t4q9yMmpo
@sivabudh8 жыл бұрын
Can we now put template implementations in source as opposed to header files now?
@nlguillemot8 жыл бұрын
Yes. Look up extern templates.
@llothar687 жыл бұрын
Are extern templates currently implemented in any compiler correctly?
@Quuxplusone6 жыл бұрын
_Extern_ templates have been implemented correctly by everyone for decades now. This is covered in Part 2 of the talk: kzbin.info/www/bejne/jHrdZ6t4q9yMmpom44s But this is not to be confused with "export templates." _Export_ templates were part of the C++98 paper standard, never got implemented, and were removed even from the paper standard in C++11. However, the short answer to Sivabudh's question is "No." I'm surprised that Nicolas said "Yes." Even if "Yes, extern templates" is _technically_ correct (see Part 2), it's not really what people usually mean when they complain about having to put their templates in header files. Extern templates are a niche solution to a niche problem.