This is just about the most perfect technical talk one could hope for. Very well done, thank you.
@03Prashanth3 жыл бұрын
I finally realised when a member function parameter in a template class is a forwarding reference. Great example, thanks!
@Moriadin3 жыл бұрын
I like how he bashes the standard now and again :) it's a refreshing change.
@VoidloniXaarii Жыл бұрын
Listened to this a bunch of times, still feel there's so much I'm not yet getting and must try again, thank you so very much
@bronekkozicki63564 жыл бұрын
Nico, thank you for giving this nice example of && ref-qualifier at 46' . It was in the standard since C++11, i.e. added alongside with std::forward and std::move (and implemented in GCC since 4.8.1), so not quite new :)
@treyquattro4 жыл бұрын
it's always great to get a new video from Nicolai. He presents information in a clear style and authoritative manner. However, the fact that we're still hashing out move semantics after a decade (plus some additions to the language in the intervening years) is disappointing. If you don't have the level of expertise of someone like Nicolai then you're going to be struggling with the esoteric aspects of C++ and template parameters in particular. In this aspect C++ is a mess. It's hardly surprising that there's been a surfeit of new C++/C-like languages cropping up in the past decade or so because they're trying to make C++ less prone to errors and consequent wasting of developer time tracking down hard-to-identify bugs caused by the ambiguity in the language, especially when it comes to template classes and functions, and yes ensuring that your move & copy code works correctly everywhere. Entirely new languages like C# have made these issues beautifully straightforward, but then they didn't have to worry about backward compatibility with a huge installed codebase. I continually hope that C++ can clean up its act and become more straightforward, but all that seems to happen is that you have to invest more time and effort understanding esoteric specialties and becoming an ever-deeper C++ expert from which there's no getting out!
@JohnCLiberte4 жыл бұрын
This is amazing. Love the sass he gives the commity :) and for a good reason!
@technologicalwaste76124 жыл бұрын
Well done. Code almost within the first minute of the presentation. Some other talks have had nearly 10 minutes of introduction before the real content begins.
@martinelzen51274 жыл бұрын
Thanks for highlighting the issue with using that 'new-ish' for implementation (the name of which I can't recall at the moment) with a reference to a container object. I got bitten by the same issue (though luckily with a page fault or something), and it was... well, unexpected, anyway.
@sochooligan4 жыл бұрын
CAN NOT see the effect of: 1>0x8002cd30:hello 2>0x8002cd30:hello 0x8002cd50:string1 What see is: the 2nd "hello" with different address from the 1st "hello".
@MalicePandrodor4 жыл бұрын
21:48 When move can be expensive? I think you meant "when move is not available and instead a copy is always done".
@nivo63794 жыл бұрын
`array` is an example. isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#f15-prefer-simple-and-conventional-ways-of-passing-information
@treyquattro4 жыл бұрын
45:41 does [[nodiscard]] on the function not help?
@chrisdams4 жыл бұрын
@24 mins: is this actually true? I thought that for a universal reference the method needs to be template and not the class. Thing is you call insertIf on an instance so T is already a given and I don't think it works in that case?
@chrisdams4 жыл бұрын
Ow, he actually adresses this immediately after. It indeed is not a universal reference in this case.
@aplced4 жыл бұрын
I am a bit puzzled by why a move on a const doesn't generate a compile time error. As mentioned in ~ 13 minute mark, there is almost (certainly?) no real life use case of const T&& it being a semantic contradiction. Why not just throw an error and eliminate possible subtle bugs.
@the_real_janvier6 ай бұрын
One would think the least the compiler could do is to show a "warning" during compilation.
@warrenbuckley32674 жыл бұрын
I wish move was the default, and copy had to be done explicitly.
@nivo63794 жыл бұрын
Move is only useful if the function needs to modify the value.
@sambatgoson69232 жыл бұрын
semantic move and forward solve some aspects but seem to make confusing.
@spinthma4 жыл бұрын
Great! Greeting from germany
@Razyelgore4 жыл бұрын
thank you so much
@EgorChebotarev8 ай бұрын
cool
@nivo63794 жыл бұрын
The point about not having const values contradicts CppCoreGuidlines which recommends tagging any constant value as const . Instead of recommending people to not use `const` , the library writers should provide the `const &&` overload. A language feature like Proposal 708 can remove the problem altogether. isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#con-constants-and-immutability github.com/hsutter/708/