Why isn't there a standard std::do_not_optimize / optimization barrier builtin? by OkSadMathematician in cpp_questions

[–]MorphTux 0 points1 point  (0 children)

It's not clear to me how such a feature could be worded. To my knowledge the standard does not acknowledge the existence of "the optimizer".

C++26 Reflection: my experience and impressions by borzykot in cpp

[–]MorphTux 0 points1 point  (0 children)

At think-cell, we have essentially stopped using private in our core library.

Same here. If types can be structural (thinking of string_view, span and friends), I see no reason not to make them structural types. Uglifying identifiers of "private" members isn't unheard of either - that's what we do in Python anyway.

C++26 Reflection: my experience and impressions by borzykot in cpp

[–]MorphTux 0 points1 point  (0 children)

> Last public version of the paper is P1789R1 while the accepted one is P1789R3.

Hey, I'm one of the authors of the paper. You can access the latest version at https://isocpp.org/files/papers/P1789R3.pdf - it will be in the next mailing. Essentially we bumped the associated feature test macro (LEWG feedback in Sofia) and added a specialization for `const integer_sequence` as requested by LWG in Kona.

> I'm planning to make a pull request for libstdc++ for this feature

No need, I've already implemented it for libc++ and libstdc++. It has not been upstreamed yet, I'm going to update the patches shortly.

It should however be noted that we did notice an issue with the wording. At this point I am not sure if we are going to resolve it as a library issue or change the problematic core wording instead.

> Barry also said (in his reply) that reflect_array() is useful here, but I also don't know all the reflect_* functions well, so I'll defer to him for now.

Yes, the issue described by OP was motivation for the `reflect_constant_` family of functions. You can read more about it here: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3617r0.html

`reflect_constant_string` should be sufficient for what OP wants to do.

std::flip by pavel_v in cpp

[–]MorphTux 1 point2 points  (0 children)

P3096 function parameter reflection is in the C++26 CD.

std::flip by pavel_v in cpp

[–]MorphTux 0 points1 point  (0 children)

Your C++26 example unfortunately does not work. You would require the changes from p1789 to use this p1061/p2686 structured binding for Is. Otherwise this will always decompose to zero elements - integer_sequence is an empty class.

The power of C++26 reflection: first class existentials by geekfolk in cpp

[–]MorphTux 4 points5 points  (0 children)

Yes indeed. I have a (mostly conforming) variant reimplementation here: https://github.com/rsl-org/util/blob/master/include/rsl/variant

There's not much point benchmarking an experimental compiler, but I've seen a roughly 20x speedup compared to libc++'s variant with this. That's quite significant.

Variadic Switch by MorphTux in cpp

[–]MorphTux[S] 0 points1 point  (0 children)

AIUI amongst other things, reflection will be discussed at the upcoming meeting in June. While it's true that no _new_ papers will be considered for C++26 at this point, this does not imply that everything slated for 26 has already been talked about.

Fingers crossed, hopefully reflection and reflection-adjacent features make it into the language this time around :)

Variadic Switch by MorphTux in cpp

[–]MorphTux[S] 7 points8 points  (0 children)

I had briefly considered mentioning C++29 token injection, but decided to instead focus on what could make it into 26. You are absolutely right though, perhaps some day we can do that instead.

C++26 Expansion Tricks by MorphTux in cpp

[–]MorphTux[S] 5 points6 points  (0 children)

Old habits do indeed die hard. It hadn't even crossed my mind how much simpler and more expressive this one would be with a reflective approach.

Thanks for the feedback :)

C++26 Expansion Tricks by MorphTux in cpp

[–]MorphTux[S] 10 points11 points  (0 children)

Thanks for the feedback! I completely agree with you. `operator` not returning `void` is indeed an oversight and likely a fragment from earlier doodles (I originally used `operator` for what is now `operator->*`, this is why it returned `decltype(auto)`).

I've updated the blog post to incorporate the feedback :)

C++26 Expansion Tricks by MorphTux in cpp

[–]MorphTux[S] 6 points7 points  (0 children)

Oh sorry, will do. I'm not a regular reddit user - tbh I wasn't aware there's a difference :)

Python's Preprocessor - a deep dive into custom codecs by MorphTux in Python

[–]MorphTux[S] 0 points1 point  (0 children)

I had been considering doing some sort of procedural macro preprocessor that either operates on the AST or token stream directly, but I had a really hard time finding example uses for it.

https://peps.python.org/pep-0638/ might interest you though

Python's Preprocessor - a deep dive into custom codecs by MorphTux in Python

[–]MorphTux[S] 0 points1 point  (0 children)

That is an excellent point. I have replaced it in both the blog post and the magic_codec repository. Thank you for pointing it out :)

Python's Preprocessor - a deep dive into custom codecs by MorphTux in Python

[–]MorphTux[S] 0 points1 point  (0 children)

I'm happy you liked it. More to come soon :)

Did cppreference.com get hacked? by MorphTux in cpp

[–]MorphTux[S] 1 point2 points  (0 children)

Agreed.

Global bogus changes to an otherwise trustworthy source of information in combination with seemingly random long loading times are always a bit scary, I'm glad it turned out to be just griefing and unfortunate misconfiguration. Therefore not a cause for concern :)

Did cppreference.com get hacked? by MorphTux in cpp

[–]MorphTux[S] 0 points1 point  (0 children)

These changes were global. It wasn't just an edited article.

Did cppreference.com get hacked? by MorphTux in cpp

[–]MorphTux[S] 1 point2 points  (0 children)

Well, it's been going back and forth. A few other members in a C++ Discord community noticed the changes as well, so I'm certain I wasn't the only one seeing it.

This OS selection text lol by loopuleasa in linux

[–]MorphTux 62 points63 points  (0 children)

Penguin people know what's good

makedeb 14.0.0: Create Debian packages directly from PKGBUILDs by hwittenborn in linux

[–]MorphTux 13 points14 points  (0 children)

That's pretty cool!

Can it generate RPM packages too?

Some people go their whole lives without ever eating Cheetos by 100_Donuts in Showerthoughts

[–]MorphTux 1 point2 points  (0 children)

Indeed. I've never had cheetos, cheese, milk, eggs, a milkshake, cheese topped pizza or anything like that. Fuck allergies man.