lingo.lol is one of the many independent Mastodon servers you can use to participate in the fediverse.
A place for linguists, philologists, and other lovers of languages.

Server stats:

66
active users

#cplusplus

1 post1 participant0 posts today
No Starch Press<p>Building your own debugger is a powerful way to understand Linux internals. </p><p>From forking and tracing to handling signals and interacting with registers, you'll gain practical insight into how debuggers actually work. </p><p>It’s also a solid exercise in writing clean, testable C++ systems code.</p><p><a href="https://nostarch.com/building-a-debugger" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">nostarch.com/building-a-debugg</span><span class="invisible">er</span></a></p><p><a href="https://mastodon.social/tags/Linux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Linux</span></a> <a href="https://mastodon.social/tags/Cplusplus" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Cplusplus</span></a> <a href="https://mastodon.social/tags/Debugging" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Debugging</span></a> <a href="https://mastodon.social/tags/SystemsProgramming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SystemsProgramming</span></a></p>
Tor Lillqvist<p>Dare I admit that I don't really understand what std::move() does? Of course I dare. <a href="https://urbanists.social/tags/CPlusPlus" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPlusPlus</span></a></p><p>Reading the "Move: What it is, and how to use it" section on <a href="https://herbsutter.com/2020/02/17/move-simply/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">herbsutter.com/2020/02/17/move</span><span class="invisible">-simply/</span></a> , and comparing to the codebase I am working on, I think I see a clear discrepancy. The code uses std::move() a *lot*.</p>
Tor Lillqvist<p>This is cool: A user-defined string literal operator that turns string literals into their (compile-time) hash codes. Might be useful in some codebases to avoid having to maintain unique numerical values for a bunch of identifiers.</p><p>(But it might be that in large codebases, the time to run all these compile-time hash functions adds up to be unbearable.)</p><p>(I was specifically thinking of the "slot IDs" in <a href="https://urbanists.social/tags/LibreOffice" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LibreOffice</span></a> that have to be manually maintained.)</p><p><a href="https://gist.github.com/Lee-R/3839813" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">gist.github.com/Lee-R/3839813</span><span class="invisible"></span></a></p><p><a href="https://urbanists.social/tags/CPlusPlus" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPlusPlus</span></a></p>
Hannes Hauswedell<p>Go home, Clang, you are drunk!</p><p><a href="https://mastodon.social/tags/LLVM" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LLVM</span></a> <a href="https://mastodon.social/tags/Clang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Clang</span></a> <a href="https://mastodon.social/tags/cplusplus" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cplusplus</span></a></p>
TechArtisan<p>Ang journey sa libo ka linya sa <a href="https://mastodon.design/tags/code" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>code</span></a> 💻 magsugod sa usa ka <a href="https://mastodon.design/tags/HelloWorld" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>HelloWorld</span></a>! 👋 Mao ni akong <a href="https://mastodon.design/tags/Cplusplus" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Cplusplus</span></a> setup sa <a href="https://mastodon.design/tags/VSCode" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>VSCode</span></a> 🚀 Gusto pud ko makakita sa journey sa uban ug makakat-on sa ilang tips sa kini nga field 🤔</p>
Paul<p>The pre and post increment operators in C++ are two different operators, so if you overload them you could make i++ and ++i do completely different things - assuming you hated the person who would have to maintain your code.</p><p><a href="https://social.xk7.net/tags/CPlusPlus" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPlusPlus</span></a></p>
Uli Kusterer (Not a kitteh)<p>I wish the C++ standard had chosen a different term than</p><p>noexcept(false)</p><p>to indicate a function can throw. Why couldn't we use throw() and throw(...) instead for doesn't throw or throws some exceptions? The former is identical to before, and the latter was invalid before, wasn't it?</p><p>And it would be similar to catch(...) !</p><p><a href="https://chaos.social/tags/CPlusPlus" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPlusPlus</span></a></p>
Uli Kusterer (Not a kitteh)<p>Say, is there a trick in C++ to make to_string() work for any type?</p><p>If I have</p><p>using namespace std;</p><p>and then just write</p><p>to_string(foo)</p><p>it will prefer my local namespace's to_string(MyClass) and error when given an int, instead of picking std::to_string(int) for those.</p><p>Do I really have to add all variants of</p><p>inline string to_string(int n) { return std::to_string(n); }</p><p>to my namespace to be able to just say to_string(foo) for any type and make it work?</p><p><a href="https://chaos.social/tags/CPlusPlus" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPlusPlus</span></a> <a href="https://chaos.social/tags/CPP" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPP</span></a> <a href="https://chaos.social/tags/CXX" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CXX</span></a> <a href="https://chaos.social/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a></p>
Uli Kusterer (Not a kitteh)<p>Some nice additions for annotating C++ code to make it import better into Swift:</p><p><a href="https://developer.apple.com/videos/play/wwdc2025/311" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">developer.apple.com/videos/pla</span><span class="invisible">y/wwdc2025/311</span></a></p><p><a href="https://chaos.social/tags/CPlusPlus" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CPlusPlus</span></a> <a href="https://chaos.social/tags/cpp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cpp</span></a> <a href="https://chaos.social/tags/cxx" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cxx</span></a> <a href="https://chaos.social/tags/swiftlang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swiftlang</span></a></p>
vitaut 🤍❤️🤍 🇺🇦<p>I'm starting to decommission std::format because of a disagreement with the C++ committee <a href="https://mastodon.social/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://mastodon.social/tags/cplusplus" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cplusplus</span></a></p>
Continued thread

Oh, I forgot my other complaint.

4) The reference implementation Radicle client is written in #Rust. Not necessarily a problem, since if the protocol takes off there will certainly be implementations in more mature languages like #Python or #CPlusPlus, but I don't love the extra bit of uncertainly with a new language along with a new protocol.

Continued thread

Hmm… just realized, there is a 5:
5. Forward-declare a struct that you define nowhere, and to which you keep a pointer in the context.

That way, no need for dynamic_cast<>, # define or generics, and you still get type-checking. The app just has to know to define that type.

#CPlusPlus mavens!

I have an "interpreter context" in my programming language. The data structure that contains the stack, current instruction register etc.

I'd like to let apps that embed my compiler/VM attach their own data structure to each such context.

What's a good solution?

1. templated context, (means the entire interpreter becomes templated)
2. void* that the app dynamic_cast<>s to its type
3. # define for the app-specific field's type (interpreter has to ship as source now)
4. ?

Things I wish they fixed in C/C++:

When you init an instance variable from a parameter, you often copy-paste the name of the instance variable into the parameter. This allows you to accidentally forget editing code and generate perfectly compiling but wrong code like:

class Foo {
public:
int _bar;
Foo(int bar) : _bar(_bar) {}
};

accidentally initializing a variable with itself instead of the parameter. (Thank goodness we have an "unused parameter” warning)

I wish I weren't a snob about such things, but the fact that most examples of breakthroughs in C++ are coming from the banking and fintech sectors isn't something that makes me more excited about the language.

"Check out this cool thing. We've used it to improve the efficiency of our HFT platform."

... gooooooooooooooood.

I know I follow a lot of indie game makers here, but I have little idea of what engines any of of you use. Anybody here know about C++ compiling? @josemachete79 is working on building his own version of #Angband from a cloned repo, and is running into issues compiling.

Any help anyone can offer would be much appreciated- I've played a test build or two of the game and it's working great except for these final compiling issues. Hit him up!

(The image below is a screenshot of the starting character I randomly generated to use when testing one of the builds.)