Explain this C++ shills

While passing by value was considered shit prior to C++11 it's now okay?
Consider the following:
[coode]
void foo(HeavyObject obj) {
consume_heavy_object(obj);
}
[/code]
The compiler will move the argument instead of copying it, correct?
Why is modern C++ such a clusterfuck?

Another example of fuckiness:

HeavyObject foo() { return HeavyObject{};}int main() { // URVO kicks in HeavyObject obj = foo(); // no RVO because lol HeavyObject obj2{}; obj = foo();}

Attached: c poz poz.jpg (347x327, 10.66K)

You just don't understand it, it's always your fault if you haven't understood every pitfall in this big beautiful language.

Old code is written without copy elision, so it will stay okay.
New code is written with copy elision in mind when working with modern compilers.
Those who do not use modern compilers can use the old way, which continues to work.
Homegamers have full control and can choose what they do and the industry has the same choice, if they switch to modern compilers then they will very likely stay with it.
Etc.

There is no problem here, but I'm sorry that you have all that melanin and or jew gene bullshit in your body that makes you retarded.

Huh, I never knew this was a thing. Although I get the feeling that C++ has a lot of weird optimizations and quirks; I don't use it enough to really know.

C++ is made complex and bloated on purpose. Stroustrup wants to add everything to please committees and industry giants. The problem is that the fads of this year is going to be added to C++. When a project coded in C++ becomes large/old enough, the danger is that it will contain every meme feature and trick. Or perhaps Stroustrup is true patriot and he made a language that niggers cant simply learn

Like , I don't understand the complaint about C++ bloat, not because it's not bloated, but because you don't have to use or even understand things you don't use.

I wrote quite a lot of C++ code (around 80k lines) but I never bothered to learn much about copy elision because it never came up. I did have to learn about above move/copy/assign/etc semantics just to use smart pointers properly, but once I knew that, that's all I needed. I also know almost nothing about threading. But I know a lot about templates. You learn what you need to and each individual part of the language is manageable in complexity.

If you just don't like the complexity because it bothers you, or you think there's a tiny chance it could affect you, that's fine, but it's basically an aesthetic preference. If you prefer to code in C for your own hobby projects, that's a fine choice, but you can't complain that businesses use C++ when it gets the job done better.

Can you explain the CRTP so a mortal can understand it?

compiler will optimise moving big objects as arguments, which is nice, but it's still some work, passing a pointer is almost always faster. But retards are afraid of pointers and people don't care about the perfomance.

The whole point is how you pass arguments that are consumed.
If you just call a function from an object that you pass in then a reference is the best option, not a pointer.
But what is the best way to pass an temp object?

void set_color(sf::Shape shape, sf::Color color) { shape.setFillColor(color);}// latersf::Shape my_shape{};set_color(my_shape, sf::Color(0xff00ff00));

What is the most efficient way to pass the color object? Do you move from it? Do you hope the compiler moves it on its own?

at home, anything that is bigger than say 4 ints I pass as pointer (I don't like references, they hide that what you pass is in fact a pointer), at work, I do whatever the reviewer wants which is often passing or returning big objects like it doesn't matter because it's less code and nobody cares about overhead like that. I do but I try not to to not lose sanity, I code my way at home.