# TartanLlama/expected

C++11/14/17 std::expected with functional-style extensions

Repository: https://github.com/TartanLlama/expected
Canonical: https://ross.abutalabs.com/products/expected
Homepage: https://tl.tartanllama.xyz
Language: C++
License: CC0-1.0
License Family: permissive
Last push: 2025-09-01T09:44:47+00:00

## Health v2 (maintenance only)
Score: 53/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 39, release rhythm 45, longevity 100
- inputs: {"age_days": 3234, "days_push": 366, "days_rel": 366, "gap_med": 25.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1879, forks 161 (observed 2026-08-28T04:05:48.459432+00:00)

## What it is
A single-header C++11/14/17 implementation of std::expected with functional-style extensions like map, and_then, and or_else. It lets developers represent values that either succeed or carry error information and chain fallible computations cleanly.

## Use cases
- represent success-or-error return values in C++ without exceptions
- chain fallible computations with monadic composition
- backport std::expected to C++11/14/17 projects
- replace verbose error-checking code with map/and_then pipelines
- handle parse results with typed error reasons

## When to choose
- you need std::expected semantics on pre-C++23 compilers
- you want a dependency-free single-header error handling utility
- you prefer functional-style error propagation over exceptions or error codes

## When to avoid
- your toolchain already ships std::expected (C++23)
- you want a full-fledged result/error framework with rich diagnostics
- your codebase style mandates exceptions for error handling

## Facets
- artifact type: library
- maturity: stable
- function: error-handling, developer-tools
- domain: developer-tools, programming-languages
- platform: cpp, cross-platform
- tags: single-header, std-expected, functional-programming, c++11, header-only, algorithms

## Member repositories
- TartanLlama/expected (main) score 53

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:48.459432+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:14:37.235716+00:00, confidence not recorded.
  - readme: https://github.com/TartanLlama/expected (fetched 2026-08-28T04:05:48.459432+00:00, sha 423c063f9e80)
- Data as of 2026-08-30T08:39:29.467469+00:00.
