How do you write a condition (C++23) that is partially constexpr-if and in part a run-time branch? If I nest constexpr-if and if, I cannot avoid duplication of the else branch. If I remove the constexpr keyword, the code is ill-formed for some specializations. 😩 I need a branch that mixes constexpr and runtime conditions! #cpp#wg21
I am head over heels excited about the CLAP plugin format, both as a musician and a developer. It's really incredible what it allows both parties to achieve. This talk by the devs was very nice, I think:
@vintprox I couldn't visit in 2023 due to my health, however I did visit all the years prior again (minus the covid online event which was remote only).
The quality in general different always widely between speakers. Some are just better than others. I do think they do recording better nowadays. I mainly missed a devroom for c/c++ and alike and a devroom about the fediverse. #fosdem2024#cpp#c#fediverse#fosdem
I really like C++, but this is the satanic ritual required to get a file modification date:
auto ftime = std::filesystem::last_write_time("file.txt");
auto stime = std::chrono::clock_cast<std::chrono::system_clock>(ftime);
auto time = std::chrono::system_clock::to_time_t(stime);
auto ltime = std::localtime(&time);
auto year = 1900 + ltime->tm_year;
auto month = ltime->tm_mon;
auto day = ltime->tm_mday;
PSA:
If your platform offers a native way to declare variables in thread-local storage (e.g. __declspec(thread) or __thread), use this instead of the C++ standardized thread_local.
The native version often offers superior codegen, even for simple types like int.
C++ problem that is driving me up a wall (using MSYS MinGW on Windows):
I'm using kubazip to programmatically extract ZIP files to a destination directory, and it stopped working with "file not found" errors when I switched to managing paths via std::filesystem::path instead of std::string
I've eliminated the input file's path as the problem by switching to reading ZIP data from memory, so it's a problem with telling kubazip the output path into which it should extract the ZIP
Trying to understand string_view from C++17. It's apparently a thin immutable container API around C++ or C style strings that gives you a subset of std::string features while being much more lightweight (due to not owning the actual data).
It's mentioned as a replacement for the const std::string& idiom, but I just got corruption when using it to catch a std::string return value (i.e. a temporary)...
Hey #gnome and #kde people, since you are at #fosdem could you maybe discuss what would it take to make a common toolkit (Linux toolkit?) that would appeal to both #c and #cpp devs? Basically covering both platforms so we could converge. Maybe #swiftlang? Fork of #Kotlin native? Seems to me we would be better off with people writing mobile apps for Linux desktop, than people writing web apps and electron garbage on desktop.
C++Online is committed to providing a safe and inclusive environment for all participants under the Berlin Code Of Conduct: https://berlincodeofconduct.org/.
Join us online for up to four days of C++ content, including livestreamed C++ talks and workshops, as well as networking through our interactive virtual venue.
New #blog post! This time we're going through a #polyglot program I wrote initially as a joke, but turned out to be lots of fun. The same source file compiles in both #cpp and #python, with some cool preprocessor shenanigans to get it all working together.