#Cxx

Uli Kusterer (Not a kitteh)uliwitness@chaos.social
2025-06-11

Some nice additions for annotating C++ code to make it import better into Swift:

developer.apple.com/videos/pla

#CPlusPlus #cpp #cxx #swiftlang

A table describing the new __counted_by(n), __noescape and  __lifetimebound annotations in Apple's clang and Swift's C parser.A table summarizing the SWIFT_NONESCAPABLE and SWIFT_SHARED_REFERENCE annotations in Apple's clang/Swift's C parser.
Uli Kusterer (Not a kitteh)uliwitness@chaos.social
2025-05-09

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)

#CXX #CPlusPlus

Duanin2, but skibididuanin2.eu@bsky.brid.gy
2025-04-16

When CMake likes building the project too much. #NotMine #cmake #cxx #develoment

cyberdoskel (@doskel.net)

2025-04-16

When CMake likes building the project too much.

#NotMine #cmake #cxx #develoment
cyberdoskel (@doskel.net)
RE: masto.doskel.net/users/doskel/…

Scott Wilsonpropersquid
2025-03-19

Anyone a master of / I'm having troubles linking the OpenImageIO_Utils library for some Rust bindings that I'm writing, and could use some help. Some more info here: github.com/dtolnay/cxx/issues/

2025-03-15

To my #c #cxx #cpp bubble:
Without trying it out -- what is the value of this expression?
uint8_t i = -1 % 128;

2025-03-15

To my #c and #cxx #cpp bubble: Why does a uint8_t get promoted to uint when doing -1 on it? Example:

#include <stdio.h>
#include <stdint.h>

int main(void)
{
uint8_t c1 = 0;
printf("%u\n", c-1);
return 0;
}

This will print (uint8_t)(c1-1) if you don't cast: (uint8_t)(c1-1)

2025-03-03

Бьёрн Страуструп призвал стандартизировать профили C++ для безопасной работы с памятью

https://www.opennet.ru/opennews/art.shtml?num=62821

#c++ #cpp #cxx #stroustrup #страуструп

---

Звучит очень круто

2025-03-02

@SandraNabbefeld
"Schamgefühl" ... nicht im Wortschatz der #Cxx

2025-01-15

Been slowly working on a #libcosmic app. It's a presentation app for my ministry and church. I originally wrote it in #C++ and #QML, but have since rewritten part of the backend to #rust with the help of #CXX-QT. This still gave me a really tricky system and I decided to investigate rust ui libraries. Seeing #system76 develop #cosmic in rust with #iced, I decided to try it, and it's working quite nice thus far. Some rough edges, but I can't wait to see it come to fruition.

pinage404.rss :nixos:pinage404@mamot.fr
2024-12-29

Interesting return of experience on the migration of Fish shell from C++ to Rust

fishshell.com/blog/rustport/

#CXX #Rust #Fish #FishShell #Shell #Unix #Linux #REx #RetEx #dev

«lambalicious»lambalicious@aleph.land
2024-12-10

Some people, when confronted with a problem in C++, think:

"I know, I'll write a custom allocator!"

Now they've run out of memory to have more problems. So I guess that's doublegoodplusone?

#cxx #cpp #programming

2024-12-04

Make the best of Rust and C++ and learn how to use them together effectively to make Qt applications safer and easier to maintain.

In this course, we'll cover:
/Use of Cargo (Rusts build system) with #CMake
/Accessing Rust code from C++ with #CXX (and vice-versa)
/Defining your #QObject types in Rust with CXX-Qt

training.kdab.com/ktd25/ #QtDev #RustLang #Cpp

«lambalicious»lambalicious@aleph.land
2024-12-02

As the saying goes in the fandom, C++ #cpp #cxx gives you enough rope to hang yourself with. IMO the smart thing to do is to use all that rope to build a rope weapon (flails ftw!) or a rope bridge. Not to, ya know, hang yourself.

The alternative saying is that C++ gives you the power to shoot your whole leg off. Well, why would you even *do* that? Use that power to shoot and blast whole zombies (or Rust telemarketers) off instead.

#ProgrammingLanguages #Programming

«lambalicious»lambalicious@aleph.land
2024-11-25

My boys! We love testing, don't we? More #cpp / #cxx questions for you to sharpen your wits and train your legalese on. Because when it comes to regulations, it's important to not leave anything to chance, even more now that the military says they want to loooooove C++ (in a "why can't you be like Rust?" way).

So:

How to make sure the caller of your function does not ignore the result?

2024-11-11

To my #cxx #cpp and #robotframework bubble: Is there any USEFUL documentation about how to debug C/C++ tests written in Robot? Like, how do I attach my gdb to inspect issues?

2024-11-07

To my #cpp #cxx #cmake bubble: I have a project with an ExternalProject_Add, where I download binaries and headers using jfrog to my CMAKE_BINARY_DIR. Trying to add the includes via target_include_directories throws an error, as the jf download didn’t run just yet and the directory is missing. How can I work around this…?

«lambalicious»lambalicious@aleph.land
2024-10-12

More #cpp / #cxx questions. As the C++ Standard iterates, it's important to keep up to date with "magic" features - that is, features that have to be implemented at the compiler level and are not "writable" in C++.

So, today's question:

What is the true purpose behind std::launder(T* p) ?

#Programming

2024-10-07

C++‘s std::async is nice. But by golly are the compiler errors unreadable if you forget to wrap call by reference arguments in std::ref! Why is it that C++ compilers are always so obtuse?

int f( int &i ) {…}
void foo() { int i; auto fut=std::async(f,i); }
-> no type named 'type' in std::__invoke_result
Fix: std::ref(i)
#cxx

Gee, #plugin #development with #JUCE is so much fun! Actually really liking the #cxx code now, too. And I have so many ideas! This working but trivial multiband compressor will evolve into the distorting "BFG Compressor" of our dreams 🥰

Plugin, testbed and some code for a multiband compressor audio plugin in development called "BFG Compressor"Trello board with lots of audio plugin ideas - synths, audio effects, visual effects and so on.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst