I hope you're doing well, came across your videos a few days ago about move semantics and keep getting your stuff recommended.
@BrewskaySA3 жыл бұрын
3 years later after watching this video, my main take away is that "it needs to be fooable!"
@kostiantynreminnyi3507 Жыл бұрын
Good job.
@LV-ei1ce5 жыл бұрын
Brilliant explanation !
@chilinouillesdepommesdeter8196 жыл бұрын
how could I master c++ like you?
@valizeth40735 жыл бұрын
Code a lot in it, doesn't really matter what, just be active in the language and always question why you're doing certain things.
@KeenlyJohnas3 жыл бұрын
Good work! Concepts will be closer to natural language programming than ever. Still C++ is quite challenging though.
@dnavas77196 жыл бұрын
Awesome explanation. Thanks.
@marcin16942 жыл бұрын
I really like that video :)
@zakiachen54433 жыл бұрын
really nice! thank you
@valizeth40735 жыл бұрын
The reason why java has Integer, Double, ... classes is because generics (sorta templates) in java don't allow primitive types, for some dumb reason. So you'll have to pass a wrapper to it.
@MGSncB3 жыл бұрын
The reason isn't dumb, actually. In java, when you create a reference type variable, what is pushed onto the stack is, well... A "reference". Which is sort of like a handle, a descriptor (for those who are familiar with WinAPI). It is opaque, and it has nothing to do with the actual address (unlike a raw pointer), you give it to the runtime and in return you get access to data. But most importantly, it is just a NUMBER, an integer (int32 or int64, depends on the targeted platform). Let's say you could create a generic method in java for primitive "int" as , with T t as method parameter. What IS that T at runtime? The JVM does not know, it is just a number AFA it knows. The type info is erased. And the body for that generic method is shared across types, so... Is that an int? A float? A reference on 32-bit platforms? Java generics is just a compiler trick with inserting casts, they are garbage (see article "Java type system is unsound"). .NET guys got it right (see "reification" - the CLR/CoreCLR preserves type information at runtime, you can do very cool things with it. Also, the JIT compiler generates a body for each value type, so you can use "int"). Not as powerful as C++ templates, though.
@amrtcpp62034 жыл бұрын
Thanks
@fuchsto6 жыл бұрын
I like everything about this video except the title: It should be "Why do we need concepts?". Concepts are about expressions. They are typically realized by means of templates but concepts and templates are independent. For example, a native pointer `int *` would satisfy the random access iterator concept.
@unusualfashion6 жыл бұрын
As this little series is about templates overall, I think the fact that these concept-like problems are typically solved using templates is a fine enough reason to emphasize that part of it. Mostly I want to introduce people to other forms of polymorphism other than inheritance, so I don't mind tying in the mechanism with the ideal. It would also likely be confusing to include the word "concepts" in the title when I'm not talking about concepts as they are/are going to be in the near future, and it would certainly make this video appear in search results where it isn't relevant and not show up in searches where people are trying to learn about templates for the first time. There's also the other use case of templates which I mention a bit when talking about vectors, where the type itself doesn't necessarily even need to have any particular concepts and is truly generic. This isn't strictly true with a vector, as certain operations require a few basic concepts (particularly if you want to talk about constructible-level things), but you could imagine some use case that is actually fully generic.
@fuchsto6 жыл бұрын
Ah, sorry, I did not realize this is part of a series. So that is to say I like everything about this video. Especially how you illustrated the comparison with interfaces.