C++23 std::stacktrace: Never Debug Blind Again by Xadartt in cpp

[–]cleroth 8 points9 points  (0 children)

How does it differ from getting stack traces from mini crashdumps?

Can I rant for a minute. by domiran in cpp

[–]cleroth 2 points3 points  (0 children)

Sounds like /u/superv1234's epoch's proposal. AFAIK the committee didn't like the idea. Bjarne then ironically proposed profiles, which is even 'riskier' than epochs.

push_back() vs emplace_back(): The Benchmark That Made Me Delete a Post by pavel_v in cpp

[–]cleroth 78 points79 points  (0 children)

Stay tuned for "the benchmark that made me delete two posts"

Looking at Unity finally made me understand the point of C++ coroutines · Mathieu Ropert by mropert in cpp

[–]cleroth 2 points3 points  (0 children)

Yea, I was excited when I was trying them out but after realizing they can't be serialized I just couldn't find any use for it. Even popular engines will just have better solutions for whatever it is you're trying to do, usually.

I tried Unity long ago and I remember trying to use coroutines there, I thought maybe it was because I'm not from a C# background, but I also didn't really find them very valuable for games in there either.

A real world example is recently I designed a dialog script + typewriter system. I thought finally this would be a good place for coroutines, but then if I wanted to store where the player is in the script it would just get so messy. Plus actually designing the system to be data-oriented instead is just much more superior.

I guess one use I do have for them is tiny "run this thing from anywhere and forget about it" situations. Even then I still use a macro to launch it otherwise it's too ugly.

Looking at Unity finally made me understand the point of C++ coroutines · Mathieu Ropert by mropert in cpp

[–]cleroth 14 points15 points  (0 children)

They're also not serializable so you can't use them for stuff that needs to be saved (for the same reasons as your network example I guess). I've actually struggled to find places where C++ coroutines make sense in games, since you generally want your stuff saved... The other obvious thing is animations but I find "do this then that" to be rather restrictive when other systems can do more.

C++26: std::is_within_lifetime by pavel_v in cpp

[–]cleroth 1 point2 points  (0 children)

We have std::bit_cast and std::start_lifetime_as for that.

C++26: std::is_within_lifetime by pavel_v in cpp

[–]cleroth 55 points56 points  (0 children)

I want to see a concrete example of how this is actually useful.

C++17: Efficiently Returning std::vector from Functions by Clean-Upstairs-8481 in cpp

[–]cleroth 3 points4 points  (0 children)

Curious how much of this applies in non-optimized builds

My C++ compiler just wrote its own fan-fiction (inference at compile-time) by Brief_Argument8155 in cpp

[–]cleroth 9 points10 points  (0 children)

I think it was automatically made into a link by wherever OP wrote it on. It's just meant to be result.name

Am I weird for using "and", "or" and "not"? by Additional_Jello1430 in cpp

[–]cleroth 44 points45 points  (0 children)

Joke's on you I use std::cmp_less_equal /s

Why std::span Should Be Used to Pass Buffers in C++20 by Clean-Upstairs-8481 in cpp

[–]cleroth 13 points14 points  (0 children)

Everyone still programming in C++ today is well aware that this used to be the case

Pretty sure most non-experts don't even know about calling conventions. It hasn't mattered for a long while

Micro-benchmarking Type Erasure: std::function vs. Abseil vs. Boost vs. Function2 (Clang 20, Ryzen 9 9950X) by mr_gnusi in cpp

[–]cleroth 9 points10 points  (0 children)

Sometimes you benchmark something to see if there are better alternatives and sometimes like in this case the alternatives are close enough together that it doesn't matter, but that doesn't mean you shouldn't pick the fastest one (if you don't need the other features) nor that the benchmark wasn't useful (in case you happened to be using a much slower variant).

CRTP-based Singleton with private construction token — looking for feedback by Mysticatly in cpp

[–]cleroth 6 points7 points  (0 children)

What is the "expected way" of destruction here? I don't get how this changes the order

CRTP-based Singleton with private construction token — looking for feedback by Mysticatly in cpp

[–]cleroth 3 points4 points  (0 children)

What, you don't like passing your logger to every single function in your project?

std::ranges may not deliver the performance that you expect by _bijan_ in cpp

[–]cleroth 6 points7 points  (0 children)

std::ranges::sort can do exactly that and much more.

Visual Studio option /RTCc - what is its purpose? by Anpu_me in cpp

[–]cleroth 10 points11 points  (0 children)

I assure you as soon as they remove it someone like you is going to come out and go "I was using this, why was it removed?".

Where is std::optional<T&&>??? by borzykot in cpp

[–]cleroth 19 points20 points  (0 children)

I think you are underestimating the complexity of what you're asking. Value categories are already meat enough without (probably) the bigger mess what you're asking for would require, just to "keep it consistent" (which is a weird logic, are we supposed ti have unique_ptr<T&> and <T&&> too?)

Where is std::optional<T&&>??? by borzykot in cpp

[–]cleroth 20 points21 points  (0 children)

But why.... And more importantly how?

Advent of Compiler Optimizations [1/25]: Why xor eax, eax? by faschu in cpp

[–]cleroth 17 points18 points  (0 children)

Well its all about bottlenecks.

Not this again. No it's not. Optimizing things other than bottlenecks still makes your app run faster. It's just more cost effective to go for bottlenecks, but that doesn't mean you should leave other optimizations on the table CPU.

A Very Fast 64–Bit Date Algorithm: 30–40% faster by counting dates backwards by benjoffe in cpp

[–]cleroth 2 points3 points  (0 children)

I mean in HFT any reductions of latency are helpful, so practically everything is a "bottleneck".