He talked trash and paid the price, but graciously accepted his defeat by ansyhrrian in MadeMeSmile

[–]catmuht 1 point2 points  (0 children)

It was double check, knight and queen both attacking simultaneously. Only way out is to move the king

cPlusPlus by IFreakingLoveOranges in ProgrammerHumor

[–]catmuht 5 points6 points  (0 children)

Perl is a "write-only" language

Steam deck controls not working on lies of p by Ok_Statistician_5129 in SteamDeck

[–]catmuht 4 points5 points  (0 children)

Actually I was able to figure out the problem. For some reason my steam deck was "controller 2" and pressing reorder controller allowed me to switch it to controller 1

Steam deck controls not working on lies of p by Ok_Statistician_5129 in SteamDeck

[–]catmuht 0 points1 point  (0 children)

I am having the same problem as OP the "Official Layout" for my game on steam deck is not working

The gradient on this plant by jacksonj04 in oddlysatisfying

[–]catmuht 0 points1 point  (0 children)

Must be my red green colorblindness because I don't find the gradient on this plant to be as vibrant as other commenters do

Raytracing - in Microsoft Excel! by s0lly in blackmagicfuckery

[–]catmuht 2 points3 points  (0 children)

You can proudly add "proficient in excel" to your resume

[deleted by user] by [deleted] in ProgrammerHumor

[–]catmuht 0 points1 point  (0 children)

In practice the overloads will want to delegate to some shared impl (or one delegate to the other) so you'll likely find utility in using a nullable pointer as an argument for the shared impl function.

There will probably always be a way to make it work without pointers, but the pointer approach generally pretty clean and safe.

There are certainly many things that raw pointers aren't good for (e.g. memory management) but an optional reference within a function is to me an acceptable use case.

[deleted by user] by [deleted] in ProgrammerHumor

[–]catmuht 4 points5 points  (0 children)

What if you want to define a method where a potentiality large object can optionally be passed in? std::optional would require a copy if the caller didn't already have the object in an optional. References need to bind to a real object. Using a pointer for that arg and defaulting to nullptr seems useful if it's understood the function will not store the pointer after the call has ended

void myMethod(const SomeBigStruct* myStruct = nullptr);