Earlier quoted context omitted.
Why would you respond to a comment about a topic you don't understand and spread false information? You clearly cannot tell the difference between garbage collected language and smart pointers.
Ah, so reference counting is not considered a form of garbage collection any more? Ingenious but somewhat of dishonest.
Retiring a favourite C++ joke
101–110 of 151 posts
Re: Retiring a favourite C++ joke
#102My favorite C++ joke is this limerick that has been in the standard for a while: When writing a specialization, be careful about its location; or to make it compile will be such a trial as to kindle its self-immolation. https://eel.is/c++draft/temp.expl.spec#8
An other one from the standard: void trex(volatile short left_arm, volatile short right_arm); // deprecated https://eel.is/c++draft/depr.volatile.type#example-3
Unfortunately too much of this will be unwound in C++ 23 because WG21 voted to un-deprecate all the volatile compound operators despite knowing nobody could even offer a rationale for why or how most of them would ever be correctly used.
Re: Retiring a favourite C++ joke
#103Re: Retiring a favourite C++ joke
#104Re: Retiring a favourite C++ joke
#105Earlier quoted context omitted.
Ah, so reference counting is not considered a form of garbage collection any more? Ingenious but somewhat of dishonest.
like the other comment said, std::unique_ptr is not ref counted. Ref counting is one of the ways to implement garbage collection but it is not garbage collection by itself. C++ does not have garbage collection.
Re: Retiring a favourite C++ joke
#106Earlier quoted context omitted.
Ah, so reference counting is not considered a form of garbage collection any more? Ingenious but somewhat of dishonest.
Smart pointers do not necessarily use reference counting. std::shared_ptr is reference counted, but std::unique_ptr is not. Needless to say that std::unique_ptr should always be the default choice and std::shared_ptr only used when actually needed.
Re: Retiring a favourite C++ joke
#107Do modern cars even allow you to step on the accelerator and the brake at the same time?
I guess you technically can’t in an EV with regenerative braking. (But maybe they do have an actual brake pedal?)
Re: Retiring a favourite C++ joke
#108Re: Retiring a favourite C++ joke
#109Earlier quoted context omitted.
Smart pointers do not necessarily use reference counting. std::shared_ptr is reference counted, but std::unique_ptr is not. Needless to say that std::unique_ptr should always be the default choice and std::shared_ptr only used when actually needed.
std::unique_ptr is reference counted, it's just that the count only goes up to BOOL_MAX instead of LONG_MAX.
Re: Retiring a favourite C++ joke
#110Earlier quoted context omitted.
like the other comment said, std::unique_ptr is not ref counted. Ref counting is one of the ways to implement garbage collection but it is not garbage collection by itself. C++ does not have garbage collection.
C++ does not have garbage collection in the standard library, just as shared_ptr was not part of the standard library in the past. You can currently have optional garbage collection in C++: https://github.com/pebal/sgcl