C++ is obsessed with operator overloading

preview_player
Показать описание


#ChernoPodcast
Рекомендации по теме
Комментарии
Автор

Let me know what you guys think of these podcast clips! I figured not everyone has time to listen to a 2h35m podcast, so maybe some highlights would be a good idea. If you want to listen to the whole thing you can do so on:

More platforms coming soon! ❤️

TheCherno
Автор

"how is the string being bit shifted into the output stream?" - young cherno

applesthepi
Автор

C++'s Hello World is the first warning they give you 😂

Mystixor
Автор

I've seen "^" be overloaded for a wedge product before "%" for cross gave me a really good laugh

on-hvco
Автор

>> makes more sense when you think about how piping works in UNIX. As for operator overloading, it is useful for hiding complexity and improve readability, but thats a double edged sword as hidden code can become complex as well.

steffennilsen
Автор

I'm a C++ teacher myself. Trying to explain by strings <<, >> are used for output and input are one of the most difficult things. I usually say that's how you do it, we'll get back to how that works later :/

aryanparekh
Автор

Chilli is the c++ memelord god. I've learned to program with him and i wouldn't want it to be any other way lol

TQM
Автор

C++ is obsessed with the standard library more than operator overloading these days.

zemlidrakona
Автор

Defining customer operators is pretty common in Haskell too. And in Haskell, you get almost complete freedom to make your own operators.

richardlewis
Автор

If you have to explain what an operator overload does, make a function instead.

jonasnorth
Автор

I went nuts when I realized that actually operators in C++ are implicitly functions. 🙃

pulse
Автор

C++ definitely suffers from feature creep, but as the creator said, not all C++ features are intended to be used by everyone. C++ is a huge toolbox and you should only use what you need.

the standard library though...

catomajorcensor
Автор

Eigen overloads the comma operator: vec << 1, 2, 3;

puyadaravi
Автор

Your thumbnails is just amazing these days

gideonjonkers
Автор

I've come from the empire of lord chili is wise in the ways of operator..

williamreji
Автор

99% of the time, I just use the good old `printf`. I find it much easier to format the output, especially if I'm outputting numbers... It performs just as fast as `std::cout` (if not faster), and it makes the code cleaner and easier to understand. The only downside is that it does not automatically flush the stdout, like `std::endl` does, so in the rare cases you need to flush, you have to use `fflush(stdout);`... Other than that, I find it superior to `std::cout`.

Автор

I feel like every C++ tutorial that shows a Hello World program should right away also explain that C++ loves operator overloading, and that literally any operator can be used for something completely different than you might expect.

I love operator overloading though. Rare use cases, but can make developing so much more intuitive if used in the right cases (like using mathematical operators +, - for vectors instead of v1.add(v2);)

managMent_
Автор

it's an obsession that i am obsessed with, it's hard to resist operator overloading in c++ too much POWER

pushqrdx
Автор

The best implied object is the lambda/functor, which is just an anonymous class with an overloaded 'call' operator function!

MatkatMusic
Автор

cpp has the most loaded hello world of all languages... you already need include, namespace, global object and that crazy operator

adampindelski