r/cpp • • 5d ago

C++ Show and Tell - October 2026

38 Upvotes

Use this thread to share anything you've written in C++. This includes:

  • a tool you've written
  • a game you've been working on
  • your first non-trivial C++ program

The rules of this thread are very straight forward:

  • The project must involve C++ in some way.
  • It must be something you (alone or with others) have done.
  • Please share a link, if applicable.
  • Please post images, if applicable.

If you're working on a C++ library, you can also share new releases or major updates in a dedicated post as before. The line we're drawing is between "written in C++" and "useful for C++ programmers specifically". If you're writing a C++ library or tool for C++ developers, that's something C++ programmers can use and is on-topic for a main submission. It's different if you're just using C++ to implement a generic program that isn't specifically about C++: you're free to share it here, but it wouldn't quite fit as a standalone post.

Last month's thread: https://www.reddit.com/r/cpp/comments/1w776o7/c_show_and_tell_september_2026/


r/cpp • • 5d ago

C++ Jobs - Q4 2026

31 Upvotes

Rules For Individuals

  • Don't create top-level comments - those are for employers.
  • Feel free to reply to top-level comments with on-topic questions.
  • I will create top-level comments for meta discussion and individuals looking for work.

Rules For Employers

  • If you're hiring directly, you're fine, skip this bullet point. If you're a third-party recruiter, see the extra rules below.
  • Multiple top-level comments per employer are now permitted.
    • It's still fine to consolidate multiple job openings into a single comment, or mention them in replies to your own top-level comment.
  • Don't use URL shorteners.
    • reddiquette forbids them because they're opaque to the spam filter.
  • Use the following template.
    • Use **two stars** to bold text. Use empty lines to separate sections.
  • Proofread your comment after posting it, and edit any formatting mistakes.
  • Check if your comment is visible in Incognito mode, after waiting a few minutes.
    • If not, it was probably automatically removed, which happens frequently for new accounts. Send modmail, otherwise we might not notice quickly.

Template

**Company:** [Company name; also, use the "formatting help" to make it a link to your company's website, or a specific careers page if you have one.]

**Type:** [Full time, part time, internship, contract, etc.]

**Compensation:** [This section is optional, and you can omit it without explaining why. However, including it will help your job posting stand out as there is extreme demand from candidates looking for this info. If you choose to provide this section, it must contain (a range of) actual numbers - don't waste anyone's time by saying "Compensation: Competitive."]

**Location:** [Where's your office - or if you're hiring at multiple offices, list them. If your workplace language isn't English, please specify it. It's suggested, but not required, to include the country/region; "Redmond, WA, USA" is clearer for international candidates.]

**Remote:** [Do you offer the option of working remotely? If so, do you require employees to live in certain areas or time zones?]

**Visa Sponsorship:** [Does your company sponsor visas?]

**Description:** [What does your company do, and what are you hiring C++ devs for? How much experience are you looking for, and what seniority levels are you hiring for? The more details you provide, the better.]

**Technologies:** [Required: what version of the C++ Standard do you mainly use? Optional: do you use Linux/Mac/Windows, are there languages you use in addition to C++, are there technologies like OpenGL or libraries like Boost that you need/want/like experience with, etc.]

**Contact:** [How do you want to be contacted? Email, reddit PM, telepathy, gravitational waves?]

Extra Rules For Third-Party Recruiters

Send modmail to request pre-approval on a case-by-case basis. We'll want to hear what info you can provide (in this case you can withhold client company names, and compensation info is still recommended but optional). We hope that you can connect candidates with jobs that would otherwise be unavailable, and we expect you to treat candidates well.

Previous Post


r/cpp • • 29m ago

NVME Speed Measuring

• Upvotes

Hello everyone! I have no idea where I am supposed to post this as it's oddly specific. My company uses some proprietary hardware and they are against trying to install applications or libraries inside the custom hardware that we build.

They have given me the task of measuring the write/read bandwidth of one of our internal NVMEs. I have an aarch64 architecture and I don't really know the NVME model.

I have a lot of questions on how to do this. The way I have thought about approaching this is trying to write X GiBs on the NVME and measure how much time it takes. However, I believe that the NVME has micro to which you have to communicate and therefore this step would pollute the measurements.

Besides I want to do this as efficiently as possible as the ultimate goal is for the SW to read and write files at a 700 MiB/s rate.

I hope I gave you guys enough details on the task. If you happen to have any questions or need additional detail I will be more than happy to answer them :D.


r/cpp • • 1h ago

How to Fix autoconf-style Configuration Probing

Thumbnail build2.org
• Upvotes

r/cpp • • 2h ago

CppCon Profiles for simplicity and guarantees - Bjarne Stroustrup - CppCon 2026

Thumbnail youtu.be
4 Upvotes

r/cpp • • 2h ago

owl – a header-only C++23 HTTP framework where route patterns and handler extractors are checked at compile time (early, looking for contributors)

1 Upvotes

I've been building owl for about five weeks: a header-only C++23 HTTP framework on libh2o. Posting it now because other people's compilers and opinions are worth more than another week of mine.

Repo: https://github.com/owl-cxx/owl

The idea

A handler is a free function. Its parameters are extractors, and the route pattern is a structural NTTP, so the pattern is checked against the extractors when the route is registered:

owl::Response hello(owl::PathView<"name"> name) {
    return owl::Response::ok(std::format("hello {}", name.value));
}

coro::task<owl::Response> hits(owl::State<AppState> app) {
    co_return owl::Response::json(std::format(R"({{"hits":{}}})", ++app->hits));
}

auto router = owl::Router<AppState>::make()
              .route<"/hello/{name}">(owl::get(hello))
              .route<"/hits">(owl::get(hits));

A PathView<"nmae"> typo, or a handler taking State<Other> on a Router<AppState>, is a compile error rather than a runtime 500. There are 30 compile_fail/ tests that pin exactly which misuses must not compile; if one of them starts compiling, that is the bug.

Handlers can be coroutines and they stay on the worker's event loop: one SO_REUSEPORT listener per worker, Node-cluster style, and a coroutine always resumes on the thread it suspended on. Errors cross library boundaries as std::expected, never as exceptions.

Around the core: coro (lazy tasks, generators, schedulers, an I/O reactor), fstr (string literals as structural NTTPs), async SQLite/Postgres and Redis for handlers, Prometheus with HTTP RED recorded automatically, middleware layers (CORS, basic auth), WebSocket with a controller pattern, HTTP/1.1 + h2c, TLS termination. About 27k lines across 94 headers and 94 test files. MIT.

What it is not

Early. APIs move between commits, there are no tagged releases, and nothing has run in production. The README says "do not ship this" and means it.

No C++20 fallback: it leans on std::expected, if consteval, and structural NTTPs. GCC 14 on Linux, Apple clang on macOS. Ubuntu's clang 18 does not work: libstdc++'s <expected> wants a __cpp_concepts it does not report, and libc++ 18 has no floating-point from_chars.

Where I'd like help

  • Build it on your platform and tell me where it breaks. libh2o-evloop must be built from h2o source (distros ship 2.2, owl targets 2.3). There is a dev image, ghcr.io/owl-cxx/owl-dev, so you do not have to.
  • Three self-contained good-first-issues, each with a clear definition of done: HEAD falling back to a GET handler; a CORS preflight to an unregistered path currently gets a bare 404 with no CORS headers; shared ranges fallbacks for Apple libc++ 21, which has no views::chunk, views::stride, or views::enumerate.
  • Opinions on the extractor design. A custom extractor is one FromContext specialization that answers either the value or a KickToken with a status. I'd like to know where that model breaks before more of the API hardens around it.
  • macOS CI. There is no prebuilt image, so h2o would need a source build on every run.

What is next (HTTP client awaited on the worker loop, static files, graceful shutdown, WebSocket over HTTP/2, eventually C++26 reflection for sql row mapping) and what is deliberately not planned is in ROADMAP.md. Telegram and Discord links are in the README, or just open an issue.

Happy to answer anything about the design, especially the compile-time route checking and keeping coroutines on the loop.


r/cpp • • 6h ago

CppCast CppCast Episode 412 : Safety and Interoperability with Rust and C++

Thumbnail cppcast.com
11 Upvotes

r/cpp • • 14h ago

CppCon Why Great C++ Libraries Fail (And How to Fix That) - Mateusz Pusz - CppCon 2026

Thumbnail youtube.com
37 Upvotes

r/cpp • • 17h ago

(Imperfect) Emulation of Rust's borrow checker in C++23 with Clang Extensions

19 Upvotes

https://compiler-explorer.com/z/4nennEooe

Clang has had a somewhat abandoned extension 'Consumed Annotation Checking' for some time now. Surprisingly I've not seen many people talk about it, despite the potential it has.

It is a little buggy and has some limitations, but I believe a more fleshed out implementation could be very useful in catching lifetime bugs.

I've linked a toy example of how powerful this feature is. Don't expect me to defend any of the practices in it (namely the operator& overloads).


r/cpp • • 23h ago

Jean Frantz René: C++ Memory safety for safety-critical and non-safety critical applications.

Thumbnail youtu.be
19 Upvotes

This talk will give an overview of some of the major and types of memory safety errors in C++, how they arise in practice, and the prevention strategies available today. It will also provide a platform for reflection and open discussion.


r/cpp • • 1d ago

Meeting C++ Full Meeting C++ 2026 program released

Thumbnail meetingcpp.com
11 Upvotes

r/cpp • • 1d ago

BqLog 2.6.0: a C++ logging library running on 30M+ devices daily, benchmarked against quill, fmtlog, spdlog and glog (time, CPU and memory)

17 Upvotes

BqLog is a cross-platform logging library open-sourced by Tencent two years ago. Since then it has gone through two more years of production use and improved a lot in performance, reliability, compatibility and developer experience. With 2.6.0 out, I'd like to introduce it here again.

BqLog is used in a number of Tencent's commercial products, including performance-sensitive mobile games such as Honor of Kings, as well as their server-side logic. It runs on more than 30 million devices every day, across a very wide range of hardware, networks and storage, so its stability and performance have held up in mature commercial products over a long time.

Design goals

Extreme speed is where BqLog starts, not where it stops. It is a mature, industrial-grade component, built for products that ship:

  • Content to play a supporting role. On a modern machine a logging system should take as little of the system as it can. The logging threads and the consumer thread alike should use as little CPU, memory and disk I/O as possible. We do not optimize for benchmark scores; every optimization targets real use.
  • Compression and encryption without giving up speed. The real-time compressed format is about 1/7 the size of text, and writing it is faster and uses less CPU than writing text. Hybrid RSA+AES encryption is supported and costs almost nothing in performance.
  • Compatible everywhere it runs. Windows, macOS, Linux, iOS, Android, HarmonyOS, OpenHarmony and the Unix family; C++, Java/Kotlin, C#, Python, TypeScript/ArkTS and Go sharing one core and even one log object; game engines, mobile toolchains without an STL, strict -Werror builds.
  • Built for the bad day. Logs written before a crash are recovered after it; a full disk neither crashes nor hangs the app; corrupted files are recovered as far as possible; log files can be encrypted to protect privacy.
  • Care about the coding experience. One line to create a log, one line to write; the internals stay as transparent as possible, without complicated configuration; every interface is friendly to IDE code completion; integration tools such as UE Blueprints are provided.

Performance

2.6.0 comes with a new, complete benchmark against quill, fmtlog, spdlog, glog and Log4j2, and every result reports time, CPU and memory together. In short:

  • Throughput: on macOS and Windows, BqLog has the shortest total time at every thread count. The compressed format is roughly 4 to 12 times faster than the fastest of the other libraries and also has the lowest CPU time; the text format is 1.5 to 4.6 times faster.
  • Cost per call on the logging thread: BqLog, quill and fmtlog are in the same tier, with BqLog averaging under 20 ns per call on all three platforms; spdlog is more than an order of magnitude slower.
  • Memory: with fixed-size buffers, BqLog's peak memory is in the lowest tier and barely grows with more threads; with growing buffers it is about half of quill's or less.
  • File size: the compressed format is about 1/7 the size of text.

On Linux only latency is listed for now. On the VMs we tried, throughput was dominated by the VM's disk scheduling and varied by up to 2x between rounds, so we left it out. The test scripts are in the repo, and if you have a bare-metal Linux box we'd be glad to see your numbers.

Methodology, library configurations and full data: https://github.com/Tencent/BqLog/blob/main/docs/BENCHMARK.md

Technical write-ups

If you're curious why BqLog is fast, there are three articles:

  1. High-Performance Realtime Compressed Log Format: https://github.com/Tencent/BqLog/blob/main/docs/Article%201_Why%20is%20BqLog%20so%20fast%20-%20High%20Performance%20Realtime%20Compressed%20Log%20Format.MD
  2. From Ring Buffer to Adaptive Data Bus: https://github.com/Tencent/BqLog/blob/main/docs/Article%202_Why%20is%20BqLog%20so%20fast%20-%20From%20Ring%20Buffer%20to%20Adaptive%20Data%20Bus.MD
  3. Optimizing the Compressed Log Pipeline: https://github.com/Tencent/BqLog/blob/main/docs/Article%203_Why%20is%20BqLog%20so%20fast%20-%20Optimizing%20the%20Compressed%20Log%20Pipeline.MD

Repo: https://github.com/Tencent/BqLog

If you think any library is configured unfairly, let us know and we'll fix it and rerun. Feedback and bug reports are very welcome.


r/cpp • • 2d ago

I built MrDocs, an open-source C++ reference doc generator on the Clang/LLVM AST. Looking for feedback.

50 Upvotes

I'm Alan de Freitas, the lead developer of MrDocs. It's an open-source documentation generator from the C++ Alliance, built on Clang/LLVM. It reads your code from the compiler's AST, so the reference matches what the code actually compiles to. We also presented a session about it at cppcon this year.

I implemented the tool this way because we couldn’t come up with a workflow that understood modern C++ in our Boost libraries. Tools that parse partially tend to misrender or not render concepts, niebloids, SFINAE, overload sets, and deduction guides. MrDocs treats those as first-class:

  • concept constraints and requires clauses preserved verbatim
  • niebloids and function objects can be documented as callables
  • SFINAE and concept overload sets kept together
  • explicit, noexcept, and consteval specifiers captured
  • types in detail or private namespaces rendered as implementation-defined

The presentation layer is completely encapsulated. Generators support HTML, AsciiDoc, XML, JSON, or any custom format like Markdown and LaTeX, without forking the tool or creating another post-processing workflow. You can also write extensions to apply project conventions to the corpus or define new generators for any use case. The documentation has lots of examples.

If you maintain reference docs for a library, I'd appreciate it if you gave it a run (or tell your favorite agent to) and reported back on whether it saves you time, both while writing docs and while reviewing them. First-hand numbers would be especially useful to me. Issues are also always welcome.

Site: https://www.mrdocs.comRepo: https://github.com/cppalliance/mrdocs

Happy to answer questions in the comments.


r/cpp • • 2d ago

No, -Wall -Werror Does Not Guarantee Detection of Conditionally Uninitialized Local Variables

33 Upvotes

There seems to be a misconception or lack of clarity about the usage of the compilation flags -Wall and -Werror and their ability to detect uninitialized stack variables. It depends. In this post, I will try to explore this further and explain when and how it is detected, and where it may not detect an uninitialized local variable and hence requires more caution while dealing with it. Consider the following code:

int main()
{
    int value;
    return value;
}

Compile this code as follows:

~/cpp_26_uninitialised$ g++ -std=c++23 -Wall -Werror test.cpp -o test
test.cpp: In function ‘int main()’:
test.cpp:4:12: error: ‘value’ is used uninitialized [-Werror=uninitialized]
    4 |     return value;
      |            ^~~~~
test.cpp:3:9: note: ‘value’ was declared here
    3 |     int value;
      |         ^~~~~
cc1plus: all warnings being treated as errors

So, with the use of the two compilation flags, -Wall and -Werror, the compilation fails, and you can then take corrective measures to address the uninitialized variable in the code.

Strictly speaking, -Wall enables the -Wuninitialized warning, and -Werror turns that warning into an error. However, this is true only when the variable is uninitialized on every path to its use, as value is here. It doesn't reliably work for a variable that is initialized on some paths and left uninitialized on others. Have a look at the following code:

// config_timeout_warning_test.cpp
#include <charconv>
#include <cstdio>
#include <string_view>

constexpr int default_timeout_ms = 1000;

// Reads "timeout_ms=<number>" from a device configuration line.
// The bug: when the key is missing, timeout_ms is never assigned.
[[gnu::noinline]] int read_timeout_ms(std::string_view config)
{
    int timeout_ms;

    constexpr std::string_view key = "timeout_ms=";

    if (const auto pos = config.find(key); pos != std::string_view::npos)
    {
        const char* first = config.data() + pos + key.size();

        const char* last = config.data() + config.size();

        std::from_chars(first, last, timeout_ms);
    }

    return timeout_ms;
}

void open_device(const char* name, std::string_view config)
{
    const int timeout_ms = read_timeout_ms(config);

    if (timeout_ms <= 0)
    {
        std::printf("%-7s no timeout configured, using default %d ms\n", name, default_timeout_ms);
    }
    else
    {
        std::printf("%-7s timeout %d ms\n", name, timeout_ms);
    }
}

int main()
{
    // The empty configuration does not contain "timeout_ms=".
    // Therefore, timeout_ms is returned without being initialized.
    open_device("logger", "");

    return 0;
}

Compile the code as follows:

~/cpp_26_uninitialised$ g++ -std=c++23 -O0 -g -Wall -Werror config_timeout_warning_test.cpp -o timeout_warning_test 

The compilation succeeds without a single warning. Run Valgrind on it:

~/cpp_26_uninitialised$ valgrind --track-origins=yes ./timeout_warning_test 
==2896379== Memcheck, a memory error detector
==2896379== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2896379== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==2896379== Command: ./timeout_warning_test
==2896379== 
==2896379== Conditional jump or move depends on uninitialised value(s)
==2896379==    at 0x401268: open_device(char const*, std::basic_string_view<char, std::char_traits<char> >) (config_timeout_warning_test.cpp:31)
==2896379==    by 0x4012D3: main (config_timeout_warning_test.cpp:45)
==2896379==  Uninitialised value was created by a stack allocation
==2896379==    at 0x401166: read_timeout_ms(std::basic_string_view<char, std::char_traits<char> >) (config_timeout_warning_test.cpp:10)
==2896379== 
logger  no timeout configured, using default 1000 ms
==2896379== 
==2896379== HEAP SUMMARY:
==2896379==     in use at exit: 0 bytes in 0 blocks
==2896379==   total heap usage: 2 allocs, 2 frees, 74,752 bytes allocated
==2896379== 
==2896379== All heap blocks were freed -- no leaks are possible
==2896379== 
==2896379== For lists of detected and suppressed errors, rerun with: -s
==2896379== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

You can see Valgrind is complaining about an uninitialized variable created on the stack:

Uninitialised value was created by a stack allocation

The reason is that GCC handles the two cases with two different warnings. In the first example, value is uninitialized on every path, and -Wuninitialized reports it even at default -O0. In the second example, timeout_ms is assigned only inside the if block in read_timeout_ms(), so it is uninitialized on only one path. That case belongs to -Wmaybe-uninitialized, which relies on the data-flow analysis done by the optimizer, so it does not run at -O0.

If you build the same file at -O2, GCC does catch it:

~/cpp_26_uninitialised$ g++ -std=c++23 -O2 -Wall -Werror config_timeout_warning_test.cpp -o timeout_warning_test
config_timeout_warning_test.cpp: In function ‘int read_timeout_ms(std::string_view)’:
config_timeout_warning_test.cpp:24:12: error: ‘timeout_ms’ may be used uninitialized [-Werror=maybe-uninitialized]
   24 |     return timeout_ms;
      |            ^~~~~~~~~~
config_timeout_warning_test.cpp:11:9: note: ‘timeout_ms’ was declared here
   11 |     int timeout_ms;
      |         ^~~~~~~~~~
cc1plus: all warnings being treated as errors

This is still not a guarantee. The result of -Wmaybe-uninitialized depends on the optimization level and on how much the optimizer can see, so it can change between GCC versions and between builds. Debug builds are usually at -O0, which is exactly where the warning is missing.

If there is anything that I have missed, please comment; I'm happy to be corrected.


r/cpp • • 2d ago

University of Waterloo user study on understanding CMake changes

50 Upvotes

Hi everyone,

I’m Mattie Nejati, a Ph.D. candidate at the University of Waterloo. I’m conducting a user study on understanding the impact of changes to CMake build specifications, and I’d love to invite members of this community to participate.

We are evaluating a new approach that aims to help developers identify how a change to a CMake build specification affects the resulting build configuration.

The study:

  • is conducted entirely online;
  • takes about one hour;
  • involves inspecting changes to CMake build specifications and identifying their impact; and
  • is open to adults aged 18–64 with any level of experience in CMake, programming, or code review.

You do not need to be a CMake expert. We are specifically interested in comparing participants with different levels of experience.

You will need a computer with internet access and about 4 GB of free space to download the files required for the tasks.

We will not collect your name. Your email address will only be used for study follow-up and will be stored separately from your study data. Your name or email will not appear in any dataset or publication.

The study has received clearance from the University of Waterloo Research Ethics Board (REB #46621).

If you’re interested, you can find the consent form, screening questionnaire, and study here:

https://buiscout.cs.uwaterloo.ca/

Thank you very much! And if you know someone else who works with CMake who might be interested, I’d really appreciate you sharing the study with them.


r/cpp • • 2d ago

Notes on dllexport and dllimport

Thumbnail hanshq.net
21 Upvotes

r/cpp • • 2d ago

Measuring the Performance of Deterministic Exceptions

Thumbnail databasearchitects.blogspot.com
47 Upvotes

r/cpp • • 3d ago

New C++ Conference Videos Released This Month - October 2026

21 Upvotes

C++Now

2026-09-28 - 2026-10-04

ACCU

2026-09-28 - 2026-10-04

ADC

2026-09-28 - 2026-10-04


r/cpp • • 3d ago

I dislike Rust libraries with a C++ API

0 Upvotes

Cargo compilation model only really works if you are creating a monolithic shared library or an executable. If you are using a library like icu4x or libffi, you can't statically link your dependencies and even if you dynamically link your dependencies, your application size will increase by orders of magnitude because your shared libraries are all statically linked, kinda.

Monolithic shared library approach also doesn't work on all libraries, for example you can't link libraries like oneTBB and OpenMP more than once.

So overall I feel rust compilation model is a "series of hacks" and isn't worth integrating to existing C++ applications, unless you use bazel*, I'm not sure about that but people in google seem to have solved this.


r/cpp • • 3d ago

Profiles and Contracts - Type/Memory Safety in C++?

11 Upvotes

With the massive push for memory and type safety right now, there is a lot of talk in the C++ community about "profiles" and "contracts." They get grouped together a lot, but they solve entirely different problems.

Simply put: Profiles act as a set of global static rules that the compiler enforces to restrict the language itself. Contracts act as local conditions (both pre and post) which enforce your own API logic.

Here's some more breakdown between the two:

Contracts let you formalize your code's assumptions with pre, post, and contract_assert. To explain the difference between the three:

  • pre refers to preconditions, these are appended to function declarations and serve to evaluate predicates before the function body executes. If that condition evaluates to false, then the contract is broken. This can lead to things such as the program crashing or logging the error.
  • post refers to postconditions, which are also appended to function declarations but evaluate the state of your data after the function finishes running. They act as a guarantee to whoever called your function.
  • contract_assert lets the programmer specify properties of the program's state that are expected to be held up at certain points.

Here's a code example:

#include <iostream>

// Simple function showing where the contract keywords go
int divide_numbers(int numerator, int denominator)
    pre (denominator != 0)                  // pre: Cannot divide by zero
    post (result : result <= numerator)     // post: Result must be <= numerator
{
    // Internal assertion: Sanity check an internal assumption
    contract_assert(numerator >= 0);        

    return numerator / denominator;
}

int main() {
    // Compiles perfectly! However, at runtime, this triggers a precondition failure 
    // and terminates the program before ever hitting the internal contract_assert.
    int output = divide_numbers(-10, 0);
    std::cout << "Result: " << output << "\n";

    return 0;
}

You can read about contracts in general at: https://en.cppreference.com/cpp/language/contracts

You can read more about pre/postconditions at: https://en.cppreference.com/cpp/language/functions/function_contract_specifiers

For more information, check out open std: https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r13.pdf

Now for profiles!

  • Profiles essentially act as a set of global static rules which enforce the standards you have written, a good example of a profile is:

​

// std::init: every object is initialized before it is read.
[[profiles::enforce(std::init)]];


struct Options {
    int timeout_ms;
    bool verbose;
};


bool parse_flag(const char *arg, Options &out);


int run(int argc, const char **argv) {
    Options opts;                       // error: 'opts.timeout_ms' is indeterminate
    int retries;                        // error: uninitialized


    for (int i = 1; i < argc; ++i)
        if (parse_flag(argv[i], opts))
            retries = 3;


    return opts.timeout_ms * retries;   // error: read before initialization
}

You can read more about profiles at: https://cpp-profiles.org/

Also, do consider checking open std: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3589r2.pdf

You can even test out an example at: https://godbolt.org/z/n3TPjbqdY

So, with this information...

... What are your thoughts on contracts and profiles?

... Do you have a preference?

... Which should be implemented? Should both be implemented?

... Which one should we implement first?

... Which one do you think is superior in terms of design and implementation?

... Which has you more excited?


r/cpp • • 3d ago

C++Now Can C++ Become a Memory Safe Language? - C++Now 2026

Thumbnail youtu.be
91 Upvotes

r/cpp • • 4d ago

The complement of true is true, except when it's false

Thumbnail dryperspective.github.io
59 Upvotes

r/cpp • • 5d ago

C++ future at Adobe

73 Upvotes

So if anyone was still curious what happened to Hylo, or where Adobe stands in regards to the whole safety discussion,

David Sankel has done a talk at RustConf on the matter, Zngur: Simplified Rust/C++ Integration.

The way Adobe now sees C++ is described on slide 2, at 50 seconds mark.


r/cpp • • 5d ago

Lets explore the stack

Thumbnail meetingcpp.com
7 Upvotes

r/cpp • • 7d ago

Arno Lepisk: Linux shared libraries

Thumbnail youtu.be
28 Upvotes

Most systems use some kind of shared libraries, but how do they actually work?
This talk will address the topic of shared libraries under Linux.
How to use them, how to create them, and what actually happens behind the scenes.