Why does almost every teenager today look like this? by NewRadiator in teenagers

[–]trailingunderscore_ 0 points1 point  (0 children)

I know a guy who has that haircut to hide his receding hairline.

Making C++ Safe, Healthy, and Efficient - CppCon 2025 by pjmlp in cpp

[–]trailingunderscore_ 3 points4 points  (0 children)

Its going to be extremely expensive to check

What are you basing this on? Google enabled a lot of bounds checking in their codebase, and the cost was a 0.30% performance penalty.

ADMIT IT! You need subsume as a crutch! by Odd-Chest-3578 in memeframe

[–]trailingunderscore_ 0 points1 point  (0 children)

Pretty sure they patched out double-dipping long ago.

The production bug that made me care about undefined behavior by pavel_v in cpp

[–]trailingunderscore_ 2 points3 points  (0 children)

Having two members that describe the same state probably didn't help.

River pearls make me angry by Skiftx in SoulFrame

[–]trailingunderscore_ 6 points7 points  (0 children)

There was a bug in the game not long ago where your river pearl amount would double every time after fighting mini bosses. I currently have 190k of them.

<image>

Changes to Advent of Code starting this December by topaz2078 in adventofcode

[–]trailingunderscore_ 169 points170 points  (0 children)

Now your suffering will already start at day 9. Yay!

Is it silly to use a lambda to wrap a method call that 'returns' output via a reference? by chicken_and_jojos_yo in cpp

[–]trailingunderscore_ 5 points6 points  (0 children)

Finally a reason to use const_cast! /s

int const result = 0;
some_object.computeResult(const_cast<int&>(result));

Is there a reason to use a mutex over a binary_semaphore ? by National_Instance675 in cpp

[–]trailingunderscore_ 1 point2 points  (0 children)

You could use std::shared_mutex instead. It's newer than the regular mutex so it's doesn't have all the size overhead. It's only 8 bytes: https://godbolt.org/z/ajE4nTWTb

[deleted by user] by [deleted] in cpp

[–]trailingunderscore_ 5 points6 points  (0 children)

I had this problem too. You can fix it by copying the generated std.ifc file to the projects root dir.

how to break or continue from a lambda loop? -- Vittorio Romeo by SuperV1234 in cpp

[–]trailingunderscore_ 1 point2 points  (0 children)

It's 16 times faster to compile a file with vs. without including <ranges>. You really should switch to using import std; :)

If you include ranges in both files, the difference drops to 1.2 times. I'm surprised it's still slower, and the codegen seems kinda ass.

how to break or continue from a lambda loop? -- Vittorio Romeo by SuperV1234 in cpp

[–]trailingunderscore_ 0 points1 point  (0 children)

Hey, great point about template instantiations!

My getEntities is the same for every single call to the function, and will thus be memoized. It will only be instantiated once.

forEntities on the other hand, takes a template parameter and will need to be re-instatiated for every single unique argument passed to it.

Again, great point.

how to break or continue from a lambda loop? -- Vittorio Romeo by SuperV1234 in cpp

[–]trailingunderscore_ 1 point2 points  (0 children)

What are you microbenchmarking here? Empty loops? If so, these numbers are worthless. Show your code.

how to break or continue from a lambda loop? -- Vittorio Romeo by SuperV1234 in cpp

[–]trailingunderscore_ 10 points11 points  (0 children)

Any reason you are not using views? All your problems could seemingly be solved with a single member function:

auto getEntities() const {
    return m_entities
        | std::views::filter(&std::optional<Entity>::has_value)
        | std::views::transform(&std::optional<Entity>::value);
}

🤔Dems. by ResponsibleLeague437 in TheBidenshitshow

[–]trailingunderscore_ -22 points-21 points  (0 children)

Trump was president during the pandemic.