nowfound

Dev tools · March 16, 2025

Cppmatch – Rust-Like Pattern Matching and Error Handling for C++

I've created cppmatch, a lightweight, header-only C++ library that brings Rust-inspired pattern matching and error handling to C++. It tries to imitate the functionality of the questionmark (?) operator in C++ by using a macro that uses the gcc extension https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html This allows to create exceptionless code with non-intrusive error-as-value that unlike Exceptions, makes it clear which kinds of error a function can generate and forces you to handle (or ignore) them. The ? operator translates to *expect* To handle the errors I…

Cppmatch – Rust-Like Pattern Matching and Error Handling for C++ launched on March 16, 2025 with 42 votes, #577 of 7,215 launches that month and more than 90% of that year's launches. The site was still online in September 2026, 1 year on.

Visit github.com ↗Alternativestop 8% of March 2025

In plain words

Cppmatch is a header-only C++ library that brings Rust-style pattern matching and error handling to C++. It enables developers to write exception-free code using error-as-value semantics, making error types explicit and forcing explicit handling. The library includes a macro-based operator similar to Rust's question mark operator and a match function for handling results and std::variant types, designed for developers seeking safer error handling patterns in C++.

written from the facts on this page · September 2026

From the sources

Contribute to Rucadi/cpp-match development by creating an account on GitHub.

A lightweight header-only Clang/GCC compatible C++ library for expressive pattern matching and error handling. Check an example in examples folder or go to compiler-explorer to play with it! A header-only C++ library that offers exceptionless error handling and type-safe enums, bringing Rust-inspired error propagation with the ? operator and the match operator to C++. The expect macro simplifies error propagation by automatically returning the error from a function when an error (Err) is encountered, and it continues with the success value (Ok) otherwise. This results in code that is both safe and easy to read without unnecessary verbosity. It allows to defer the error-checking to the point…from github.com

In the maker’s words, at launch

I've created cppmatch, a lightweight, header-only C++ library that brings Rust-inspired pattern matching and error handling to C++. It tries to imitate the functionality of the questionmark (?) operator in C++ by using a macro that uses the gcc extension…

Does a similar job

all alternatives →
  • Compile-time HTML parsing in C++142017 · github.com · ▲175

    A C++ HTML template engine that uses compile time HTML parsing - rep-movsd/see-phit

  • Match(it): A C++17 pattern-matching library with lots of good stuffs2022 · github.com · ▲85

    A lightweight single-header pattern-matching library for C++17 with macro-free APIs. Try it at https://godbolt.org/z/8YMr8Kz8j

  • I built a small browser engine from scratch in C++Jan 2026 · github.com · ▲146

    Hi HN! Korean high school senior here, about to start CS in college. I built a browser engine from scratch in C++ to understand how browsers work. First time using C++, 8 weeks of development, lots of debugging—but it works! Features: - HTML parsing with error correction - CSS cascade and inheritance - Block/inline layout engine - Async image loading + caching - Link navigation + history Hardest parts: - String parsing(html, css) - Rendering - Image Caching & Layout Reflowing What I learned (beyond code): - Systematic debugging is crucial - Ship with known bugs rather than chase…

  • Online C/C++ Code Browser2016 · code.woboq.org · ▲72

    Codebrowser homepage

  • AI
    Anyone interested in a tool helps to explore C++ ASTsMay 2026 · uvic-aurora.github.io · ▲49

    I built this software to help users who need to do static code analysis for C/C++ codebase. This can help you to explore the ASTs interactively. It can replace the Clang ast dump completely and also you can search the code/ASTs in a structual way. For example you can search a function which matches specific name or number of paremeters.

  • Header-only, extensible C++17 argument parser2016 · github.com · ▲21

    ⛳ Simple, extensible, header-only C++20 argument parser released into the public domain. - sailormoon/flags

More dev tools this month

the category →
  • /dev/null▲482

    a social network for devs

    Dev tools · 3d ago · dev-null.sh

  • open-source IDE for thoughtful software design. Contribute to devdotfast/whiteboard development by creating an account on GitHub.

    Dev tools · 28d ago · github.com

  • Contribute to reladraw/reladraw development by creating an account on GitHub.

    Dev tools · 26d ago · github.com

  • OpenBot▲362

    Grok Bot alternative: free, local, open-source, multiplayer

    Dev tools · 23d ago · openbot.run

  • Talanoa▲346

    Hi HN, I’m a fullstack developer, and honestly, I’ve lost count of how many side projects I’ve worked on over the years. But one idea kept coming back to me: a different kind of email client. It first came to me in 2014: “What if we could handle emails more like conversations?” Every year, I’d revisit this concept in my “Build Notes.” Ten years later, no one had built exactly what I had in mind — so I finally decided to do it myself. That’s how Talanoa was born. I wanted something focused on people, not timelines. I was tired of marking messages as unread just to remember to reply later, or…

    Dev tools · 20d ago · talanoa.email

  • CoreSpeed▲332

    One MCP for everything your agents need: apps, memory, tools

    Dev tools · 28d ago · corespeed.io

Source: Show HN post ↗ · launch text quoted in part

Launched alongside, March 2025

the whole month →
  • Mimic Human Research & Save Findings in AI Knowledge Base

    AI · 2025 · sider.ai

  • Turn your ideas into products that sell

    AI · 2025 · atoms.dev

  • Aha▲1,152

    The world's first AI influencer marketing team

    AI · 2025 · ahacreator.com

  • Fluently▲976

    Start speaking English as well as your native language

    AI · 2025 · getfluently.app

  • Conversational AI surveys, interviews, user tests, polls

    AI · 2025 · theysaid.io

  • Record your screen, share instantly, look like a PRO

    Growth · 2025 · supercut.ai