C++

!cpp

@programming.dev
Create post
The empire of C++ strikes back with Safe C++ blueprint

The empire of C++ strikes back with Safe C++ blueprint

Open link in next tab

The empire of C++ strikes back with Safe C++ proposal

https://www.theregister.com/2024/09/16/safe_c_plusplus/

You pipsqueaks want memory safety? We'll show you memory safety! We'll borrow that borrow checker

The empire of C++ strikes back with Safe C++ proposal
An Overview of C++26: Concurrency

An Overview of C++26: Concurrency

Open link in next tab

An Overview of C++26: Concurrency – MC++ BLOG

https://www.modernescpp.com/index.php/an-overview-of-c26-concurrency/

Using Conan as a CMake Dependency Provider

Using Conan as a CMake Dependency Provider

Open link in next tab

Using Conan as a CMake Dependency Provider

https://dominikberner.ch/conan-as-cmake-dependency-provider/

With the addition of dependency providers in CMake 3.24 using Conan to manage dependencies becomes easier and more integrated. This post shows a step-by-step guide on how to use Conan as a CMake dependency provider.

Using Conan as a CMake Dependency Provider
Comprehensive C++ Hashmap Benchmarks 2022

Comprehensive C++ Hashmap Benchmarks 2022

Open link in next tab

Comprehensive C++ Hashmap Benchmarks 2022

https://martin.ankerl.com/2022/08/27/hashmap-bench-01/

Where I've spent way too much time creating benchmarks of C++ hashmaps

Comprehensive C++ Hashmap Benchmarks 2022
Sanitize your C++ containers: ASan annotations step-by-step

Sanitize your C++ containers: ASan annotations step-by-step

Open link in next tab

Sanitize your C++ containers: ASan annotations step-by-step

https://blog.trailofbits.com/2024/09/10/sanitize-your-c-containers-asan-annotations-step-by-step/

By Dominik Klemba and Dominik Czarnota AddressSanitizer (ASan) is a compiler plugin that helps detect memory errors like buffer overflows or use-after-frees. In this post, we explain how to equip y…

Sanitize your C++ containers: ASan annotations step-by-step
C++20 Modules: The possible speedup (2021)

C++20 Modules: The possible speedup (2021)

Open link in next tab

C++20 Modules: The possible speedup

https://andreasfertig.blog/2021/09/cpp20-modules-the-possible-speedup/

C++20's modules are one feature of the big four, supposed to influence how we write C++ code in a huge way. One expectation I hear near...

C++20 Modules: The possible speedup
Giving C++ std::regex a C makeover

Giving C++ std::regex a C makeover

Open link in next tab

Giving C++ std::regex a C makeover

https://nullprogram.com/blog/2024/09/04/

ACBS - Another C Build System (compatible with C++)

ACBS - Another C Build System (compatible with C++)

I created a little side project over the past few days, a new build system for C and C++: https://github.com/blueOkiris/acbs/

I've seen a lot of discourse over C build tools. None of them really seem solid except for (some) Makefiles (some Makefiles are atrocious; you just can't rely on people these days). Bazel, cmake - they're just not straight forward like a clean Makefile is, basically black magic, but setting up a Makefile from scratch is a skill. Many copy the same one over each time. Wouldn't it be nice if that Makefile didn't even need to be copied over?

Building C should be straight forward. Grab the C files and headers I want, set some flags, include some libraries, build, link. Instead project build systems are way way way overcomplicated! Like have you ever tried building any of Google's C projects? Nearly impossible to figure out and integrate with projects.

So I've designed a simplistic build system for C (also C++) that is basically set up to work like a normal Makefile with gcc but where you don't have to set it up each time. The only thing you are required to provide is the name of the binary (although you can override defaults for your project, and yes, not just binaries are possible but libs as well). It also includes things like delta building without needing to configure.

Now there is one thing I haven't added yet - parallel building. It should be as simple as adding separate threads when building files (right now it's a for loop). I know that's something a lot of people will care about, but it's not there yet. It's also really intended to only work with Linux rn, but it could probably pretty easily be adjusted to work with Windows.

Lay your project out like the minimal example, adjust the project layout, and get building! The project itself is actually bootstrapped and built using whatever the latest release is, so it's its own example haha.

It's dead simple and obvious to the point I would claim that if your project can't work with this, your project is wrong and grossly over-complicated in its design, and you should rework the build system. C is simple, and so should the build system you use with it!

So yeah. Check it out when y'all get a chance

noexcept affects libstdc++’s unordered_set

noexcept affects libstdc++’s unordered_set

Open link in next tab

noexcept affects libstdc++’s unordered_set

https://quuxplusone.github.io/blog/2024/08/16/libstdcxx-noexcept-hash/

The other day I learned a new place where adding or removing noexcept can change the performance of your program: GNU libstdc++’s hash-based associative containers change the struct layout of their nodes depending on the noexceptness of your hash function. This is laid out fairly clearly in the docs; it’s simply bizarre enough that I’d never thought to look for such a thing in the docs!

What’s so hard about class types as non-type template parameters?

What’s so hard about class types as non-type template parameters?

Open link in next tab

What’s so hard about class types as non-type template parameters?

https://brevzin.github.io/c++/2024/08/15/cnttp/

Setting the Stage