Тёмный

CppCon 2014: Scott Meyers "Type Deduction and Why You Care" 

CppCon
Подписаться 149 тыс.
Просмотров 107 тыс.
50% 1

www.cppcon.org
-
Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/CppCon/CppCon2014
--
C++98 had template type deduction, and it worked so intuitively, there was little need to understand what took place under the covers. C++11 extends type deduction to include universal references, applies it to auto variables and lambda expressions, then throws in a special auto-only deduction rule. C++14 pushes the boundary further, adding two forms of function return type deduction (auto and decltype(auto)) for arbitrary functions and offering auto parameters for lambdas. The result is that what could be treated as a black box in C++98 has become a topic that practicing C++ developers really need to understand. This talk will give you the information you need to do that.
--
Scott Meyers has been working with C++ since 1988. He recently finished his new book, "Effective Modern C++".
--
Videos Filmed & Edited by Bash Films: www.BashFilms.com
*-----*
Register Now For CppCon 2022: cppcon.org/registration/
*-----*

Опубликовано:

 

1 окт 2014

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 75   
@fmatthew5876
@fmatthew5876 9 лет назад
Scott's talks make me shake my head in despair at the design decisions and complexity of the C++ type system.
@gast128
@gast128 7 лет назад
Good talk though it seems to me that those C++ committee members actually don't make things simple as possible. Do they realize that ordinary C++ programmers have to deal with the domain and application complexity as well on top of all these rules?
@sunilpatidar5641
@sunilpatidar5641 18 дней назад
Just came here to revise the first two chapters of effective modern c++ by this guy himself.
@thestarinthesky_
@thestarinthesky_ 6 месяцев назад
Great talk! Too bad we don't get to see you in CppCon anymore :( Thanks for all the wonderful works you've done!
@maxx666mayhem
@maxx666mayhem 8 лет назад
Excellent video about an exciting feature in C++11 ... thanks for uploading
@erikvanvelzen
@erikvanvelzen 9 лет назад
Great talk. This is simple and we're all supposed to know this, yet it is so refreshing to see it all mentioned in once place.
@danteslog5887
@danteslog5887 Год назад
Simple is once you understand it , I had to read the chapter 2 to 3 times but once I got it , it was simple 😢
@jianwang4188
@jianwang4188 5 лет назад
Wonderful! It is not easy to be one C++ expert who is always syncing with latest standardization.
@karas44
@karas44 2 года назад
Wondeful talk in CPP histroy!
@treyquattro
@treyquattro 6 лет назад
at 34:48 when someone in the audience points out a mistake and Scott acknowledges it, has the slide been updated because it looks correct to me based on what it says and what Scott has been saying prior.
@think2086
@think2086 2 года назад
I think so.
@rationalcoder
@rationalcoder 7 лет назад
He has always seemed to me to be quite full of himself, but he is an undeniably good presenter. Great talk!
@llothar68
@llothar68 7 лет назад
Yeah, definitely the guy you want to have as a teacher but never as someone to join you when drinking a beer. Not sure about Herb Sutter but about Scott.
@davidward6779
@davidward6779 6 лет назад
I think he's earned the right to be sure in his abilities.
@enricomariadeangelis2130
@enricomariadeangelis2130 5 лет назад
This man is amazing!
@NonTwinBrothers
@NonTwinBrothers 8 месяцев назад
Excellent talk by Richard Clayderman!! 😊
@berajpatel8081
@berajpatel8081 4 года назад
Thank you Scott
@sanjuuyonsai
@sanjuuyonsai 9 лет назад
no conclusion of the hair poll?
@antiHUMANDesigns
@antiHUMANDesigns 5 лет назад
I think Luke Skywalker when I see his hair.
@ayseryucel
@ayseryucel 5 лет назад
@CppCon i can see Scott point this and that in the slide but can't see anything what he is pointing on the slide placed on the left side of the video. it makes it hard to follow.
@magetaaaaaa
@magetaaaaaa Год назад
I don't know much about the industry, but isn't this guy some C++ legend or something? Lol.
@arkadye
@arkadye 9 лет назад
The webpage he gave says He-Man won it, just.
@Runoratsu
@Runoratsu 6 лет назад
And deservedly so! He should really cosplay as He-Man sometime, it would be hilarious… :D
@georganatoly6646
@georganatoly6646 2 года назад
'back in my day' (with C) to make a generic interface you made the underlying structs and funcs an int or long and let someone else build some more specialized wrappers on top that by explicitly casting and packing their arbitrary data types into those ints, in effect treating an int or long or w/e as if they were assembly-like general registers, so that users of the higher level wrappers didn't have to worry about any implicit type deduction rules and the implementers didn't have to worry about edge cases cropping up unexpectedly (this was in effect using C's version of inheritance combined with C's much stronger encapsulation to achieve the same effect, trading quick but complicated/possibly brittle templates with slower, explicit, but more strictly defined generics)
@blazsovdat6433
@blazsovdat6433 8 лет назад
Do we have an explanation regarding why is there a special auto rule for doing type deduction for braced initializers?
@tetramaximum
@tetramaximum 5 лет назад
Blaž Sovdat yes, we do. en.cppreference.com/w/cpp/language/direct_initialization see the second form.
@logicboard7746
@logicboard7746 Год назад
This is truly attending a C++ class at a college
@joe-ti8rz
@joe-ti8rz 6 лет назад
dankjewel meneer maand 3 zit erop
@disk0__
@disk0__ 5 лет назад
Even after I double checked the video and the hair was different, Scott is always Double Dream Feet in my mind
@jakobullmann7586
@jakobullmann7586 3 года назад
To be honest, I like N3922... Immediately before slide 20 I thought: "This does not make sense." And then slide 20 came: "Yeah, that's how it should be."
@michaelmorris2300
@michaelmorris2300 6 лет назад
C++ will soon stand for convoluted ++
@hanyanglee9018
@hanyanglee9018 2 года назад
Do we have a new talk on c++20 concept and constrains?
@Dziaji
@Dziaji 2 года назад
At 35:00, there are literally no >= 1 in the entire slide. It says >1, just like he meant it to. The comment from the audience is wrong, and Scott agreed for some strange reason.
@andreitolkachev8295
@andreitolkachev8295 2 года назад
The slides in the video are updated
@hakoo2700
@hakoo2700 4 года назад
amazing! tnx >_
@ulidtko
@ulidtko 9 лет назад
Agreed. The type system of C++ is becoming a really screwed dump.
@gareginasatryan6761
@gareginasatryan6761 6 лет назад
Maxim Ivanov not worse than javascipt
@andreitolkachev8295
@andreitolkachev8295 2 года назад
@@gareginasatryan6761 Difference is, nobody really gives a shit about performance in such languages (JS, Python), but for C++ which is supposed to be a high-performance language, it's bad indeed.
@mwont
@mwont 8 лет назад
and i thought that type deduction was easy. i was so wrong!
@pspimf
@pspimf 7 лет назад
Slide 17 is missing in the video, unfortunately
@jochen_schueller
@jochen_schueller 4 года назад
The standard doesn't guarantee that slides have to be contiguously allocated, it only requires a strict order. If you really need to iterate via raw page numbers without being at risk of a page fault, consider using a book or journal instead.
@timwhite7127
@timwhite7127 7 месяцев назад
Actually, when you brought up the hair topic my mind went straight to John Fogerty.
@alexeybeloushko7240
@alexeybeloushko7240 6 лет назад
is it something with me? or auto x3 {17} was unintentional due to bugs in lexer? and than to cover for it necroSoft put a proposal in N9322 ?
@movax20h
@movax20h 4 года назад
It was supposed to work, because 'int x3{17}' works. Why one earth would you write 'int x3{17}', and want it to fail to compile with can't initialize int from initalizer_list.
@anon_y_mousse
@anon_y_mousse 9 месяцев назад
@@movax20h I think he meant the syntax of `type t { ... }` as opposed to the much better syntax of `type t = { ... }`. At least I hope he means that because I personally detest that form of object construction and equally the method of type inference that C++ incorporates.
@HarikrishnaNalla9
@HarikrishnaNalla9 3 года назад
A confident programmer swag at 49:41
@user-vs6kl8ph5v
@user-vs6kl8ph5v 8 месяцев назад
the opening speech 😭
@wpavada3247
@wpavada3247 7 лет назад
can someone explain what he said at 27:44 ?
@brainplot
@brainplot 5 лет назад
"[...] so they're only ignored if you're making a completely independent value."
@hanyanglee9018
@hanyanglee9018 2 года назад
The whole thing needs an overhaul. If some way of programming doesn't make any sense, it should be a compiling error, not a weird deduction rule. If auto were always without any vcr and if there is any implicit conversion, it's at least a warning, the rules would be way less. An analog is the == in javascript. It tries to help but only messes.
@Legorz3373
@Legorz3373 9 месяцев назад
Slides 17 and 37 missing
@GeorgeTsiros
@GeorgeTsiros 5 лет назад
can we use different names for rvalue and lvalue? after a while it gets tiring trying to follow the speaker >_
@Webfra14
@Webfra14 5 лет назад
I suggest ^nanana and °nanana...
@anon_y_mousse
@anon_y_mousse 9 месяцев назад
How about can and not? Can for l-value because you can assign, and not for r-value.
@pavel_trpn
@pavel_trpn 9 месяцев назад
At 33:35 he looked exactly like John Bon Jovi!!!
@soulstudiosmusic
@soulstudiosmusic 9 лет назад
Another title: "Type deduction and why you probably shouldn't use it, because it's convoluted, difficult to ascertain, subject to change and probably will only save you a few lines of code at the cost of long-term code reuse and ability to interpret code".
@lincolnsand5127
@lincolnsand5127 4 года назад
Ehhhh. Not really true at all. Auto doesn't allow the kinds of bugs that explicit types introduce. He recommends using it in "code::dive C++14 for embedded"
@apivovarov2
@apivovarov2 6 месяцев назад
Guy has switched to D. is it true???
@Babs42
@Babs42 6 лет назад
He forgot Michael Angelo Batio (MAB).
@risingpower
@risingpower 8 лет назад
he needs some conditioner
@Spiderboydk
@Spiderboydk 9 лет назад
Oh god, this is a mess. This is more complicated than SFINAE :-)
@almighty1984
@almighty1984 10 месяцев назад
Being Swedish, to me he looks like a cross between Ted Gärdestad and Christer Petterson (w/o the alcoholism)
@esad9341
@esad9341 7 лет назад
as awesome as Scott is, I still prefer c
@ulidtko
@ulidtko 9 лет назад
"Type deduction _of C++_ ..." you mean, right? In other languages (which have type system more powerfull than C++'s and yet don't undergo uncontrollable complexity blowup) type inference is a very helpful tool, used daily with joy.
@d46512
@d46512 6 лет назад
If he got a haircut Scott would look and sound just like Peter Gregory!
@mohammedj2941
@mohammedj2941 3 года назад
Exactly. Although I don't know who Peter Gregory is.
@eddykohlmann471
@eddykohlmann471 2 года назад
Standup ++
@JanPBtest
@JanPBtest 8 лет назад
Two reasons: (1) Life is complicated so anything that's going to do even halfass job at modelling it WILL be complicated. Just ask any physicist. (2) C++ cannot introduce features in the best and easiest possible way because of a certain real-life constraint called "backward compatibility". It's simply impossible to suddenly declare millions of line of code out there invalid because of some gorgeous theoretical advance in language development.
@rnk1415
@rnk1415 6 лет назад
Life was good till the type system of C++ is screwed.
@jasonli1194
@jasonli1194 5 лет назад
a braced initialiser has no type
@Webfra14
@Webfra14 5 лет назад
naaaaah... you didn't say it three times... you didn't really mean it...
Далее
Это база
00:16
Просмотров 151 тыс.
Can this capsule save my life? 😱
00:50
Просмотров 3,3 млн
Scott Meyers   An Effective C++11 14 Sampler
1:15:45
Просмотров 22 тыс.
The Tragedy of systemd
47:18
Просмотров 1,1 млн
Это база
00:16
Просмотров 151 тыс.