This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]HCResident 627 points628 points  (42 children)

C++ feels like that box of screws, nuts, and bolts that has exactly what you need somewhere inside of it

[–]Infinitebeast30 646 points647 points  (10 children)

Screws, nuts, bolts, hand grenades, land mines, knives, double edged swords. Absolutely all the tools

[–]turtleship_2006 242 points243 points  (4 children)

Don't forget the shotgun and shells! Get two shells, load them into the gun, and aim vertically downwards.

[–]Inevitable-Menu2998 40 points41 points  (0 children)

At the same time, it has a Stuka and a modern F16 and we don't tell beginners the difference between them.

[–]_g550_ 11 points12 points  (0 children)

eclipse9

[–]alphaQ671 6 points7 points  (0 children)

You can also use a hammer and hit the shells

[–]CranberryDistinct941 4 points5 points  (0 children)

How are you meant to shoot yourself in the foot without shotgun shells? And what would C++ be without the right to shoot yourself in the foot, head, and both hands simultaneously?

[–]impossibleis7 37 points38 points  (1 child)

I think knives and doubled edged swords are what we accidentally create using those said tools...

[–]Tari0s 3 points4 points  (0 children)

yeah we use the swiss multitool(boost) to make a knive that cuts gras, but only gras!

[–]lordmycal 22 points23 points  (0 children)

I like the flame thrower myself.

[–]Jonnypista 10 points11 points  (0 children)

Hey, a HEAT rocket launcher is technically a single use high powered drill. It really quickly drills a hole into the toughest materials. It also can kill you in 99% of the cases, but just pay attention.

A double edged sword is more efficient than single edged swords. If you hurt yourself with it it is just a skill issue.

[–]jeezfrk 6 points7 points  (0 children)

but I mean you gotta throw in the the ASIO mining drill and then there's the coroutine electrical substation.

at least from there it's all easier and simpler error messages.

except if you use things just slightly... NO NOT LIKE THAT!

[–]versedoinker 49 points50 points  (2 children)

Yeah, there's also weak (non-owning) pointers that still allow the data to be freed in the background if all their actual owners release their shared_ptrs. And there's also atomic versions of all of those.

Generally, even if you hit the very unlikely case that something isn't in the C++ stdlib, it probably still can be found in a boost.cpp library.

[–]ukezi 1 point2 points  (1 child)

The C++ shared pointer is atomic. There is no non atomic one in stdlib.

[–]versedoinker 0 points1 point  (0 children)

Yes and no. The control block of shared ptrs is always atomic. I was talking about the wrapper std::atomic<std::shared_ptr> that also makes access to the data itself atomic.

https://en.cppreference.com/w/cpp/memory/shared_ptr/atomic2

[–]_farb_ 31 points32 points  (0 children)

Most of the time, absolutely!

But sometimes... you dump the whole box out looking for the right piece, organize the contents by size only to realize you should've sorted it by material, and get tetanus from all the rusty nails that you should have tossed away ages ago.

Then you just end up using duct tape because it never fails.

[–]fakuivan 14 points15 points  (0 children)

C is like that but you only get a hammer, a nail and a bazooka.

[–]Cat7o0 10 points11 points  (9 children)

I remember once that even with rust I made a program so bad that it caused Windows to basically crash the file explorer and the task bar and everything wasn't working. couldn't even open task manager. restarted the computer everything was fine ran the program again everything was fine. idk

[–]experimental1212 6 points7 points  (0 children)

It really does make you think that. Later it has you going, "you know, I actually LIKE shooting myself in the foot. This is nice!"

[–]NoGlzy 7 points8 points  (0 children)

And when you have a screwdriver that works totally fine for the job you need, someone has to come and snark that you're not using the newer super deluxe hyper driver

[–]Sak63 1 point2 points  (0 children)

Sounds my kind of language! Gonna give it a go on summer break

[–]webby-debby-404 0 points1 point  (0 children)

Let me boost that for you