home.social

#cpluscplus — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #cpluscplus, aggregated by home.social.

  1. I'm **completely blown away** by C++'s std::variant visitor pattern.
    How does it work?
    How can it work?
    Is it black magic?

    godbolt.org/z/bKddhnjhW

    #cpp #cpluscplus

  2. May I make you aware of the phantastic @compiler_explorer, that totally indispensable tool to every software developer - the brainchild of @mattgodbolt ?

    I can speak only as an average C++ developer who works at a small company, and who happens to be stranded in the C++ committee.

    For my own experiments, I have a personal bookmark in my browser called "C++23 playground" as a starting point for for more elaborate adventures in the C++ lands. May be, it helps you as well:

    godbolt.org/z/Mz96j16nx

    To the best of my knowledge, the provided flags will give you some highly recommended defaults for compiler diagnostics and maximum language conformance, in the three major implementations Clang/libc++, GCC/libstdc++, and MSVC/MS-STL. Maybe you'll get some inspiration for your daily grind.

    Please support Matt and the entire CE team 🤘, f.e. by getting some swag that we nerds can proudly present in the public and wear as protective gear ☺️

    Visit shop.compiler-explorer.com/pro 🤩

    #cpp #cpp23 #cplusCplus #programming

  3. Rust does seem to have a lot of nice features. My biggest blocker for me going to Rust from C++ is that C++ has much better support for generic programming. And now that Concepts have landed, I'm not aware of any language that can compete in this area.

  4. My little daisyseed synth project is currently stalling on the whole "C++ is just the WORST language" problem.

    There's a class in the DaisySP library which is *almost* what I want. So I should be able to just subclass it and work from there, right?

    Well, no, because none of the functions that I want to override are declared "virtual", so I'd have to edit and re-build the library.

    I'm sure this is all in the service of runtime efficiency, at some level. But, you know - it's a 480MHz ARM processor. I think a little indirection wouldn't be a huge deal.

    I will just write the whole thing from scratch, all 100 lines or so of it. But it's *IRRITATING*, you know?

    #daisyseed #CPlusCplus #embedded #synthdiy #synth

  5. "The only way to learn a new programming language is by writing programs in it."
    – Dennis Ritchie

    Therefore C++ is not a programming language.

    #CPlusCplus

  6. As I was going through and working on some puzzles I noticed that an inordinately large amount of the problems on leetcode all have Permutations at their core.

    After a little bit of research, it turns out that I had been generating permutations suboptimally this entire time.

    The most efficient implementation is something called Heap's Algorithm, which I have to admit I had never heard of. So, here it is.

    github.com/aeu/legible-algorit

    #programming #cpp #CPlusCplus #algorithms

  7. ArkScript December 2024 update is here!

    lexp.lt/posts/arkscript_update

    Quite a long read because there was a lot of changes. I’m now thinking I should maybe do a 2024 article wrap?
    Or people can just read lexp.lt/categories/arkscript/ if they want to see everything 🤔

    #compiler #cpp #cpluscplus #opensource #pldev #ArkScript

  8. Some first steps to integrate #doxygen in my #opensource project. Feels ok so far. There are only some hiccups resolving references.

    #programming #CPlusCplus #foss #cpp

  9. Some first steps to integrate #doxygen in my #opensource project. Feels ok so far. There are only some hiccups resolving references.

    #programming #CPlusCplus #foss #cpp

  10. Can I haz faster clang-tidy with even more checks, please? 😺

    #clangtidy #CPlusCplus #cxx

  11. Whoever brought #HeaderOnly libraries to C++ shall be forever banned from any computer. What a nasty person!

    #CPlusCPlus #Programming