tiny::optional โ€“ a C++ optional that does not waste memory

This page summarizes the projects mentioned and recommended in the original post on /r/cpp

JetBrains - Tell us how you use coding tools. You may win a prize!
Are you a developer or a data analyst? Share your thoughts about your coding tools in our short survey and get a chance to win prizes!
surveys.jetbrains.com
featured
Sevalla - Deploy and host your apps and databases, now with $50 credit!
Sevalla is the PaaS you have been looking for! Advanced deployment pipelines, usage-based pricing, preview apps, templates, human support by developers, and much more!
sevalla.com
featured
  1. tiny

    low-level library for minimizing the size of your types (by foonathan)

    I actually came across the term "tombstone" before, in the "foonathan/tiny" library. I found that one after I started building tiny::optional, and it seems to have similar use cases, but also seemed abandoned and not to implement a fully fledged std::optional replacement. So maybe he got the idea from the talk by Arthur O'Dwyer.

  2. JetBrains

    Tell us how you use coding tools. You may win a prize! Are you a developer or a data analyst? Share your thoughts about your coding tools in our short survey and get a chance to win prizes!

    JetBrains logo
  3. tiny-optional

    Replacement for std::optional that does not waste memory unnecessarily

    tiny::optional is a header-only C++ library for x86/x64 intended to be a drop-in replacement for std::optional with the twist that it does not require additional memory for bools, floats, doubles and raw pointers. For example, a std::optional has twice the size of a raw double because of 7 padding bytes after the internal bool. These wasted bytes can have a notable impact on performance in memory bound applications. On the other hand, a tiny::optional has the size of a double by exploiting unused bit patterns (i.e. by exploiting platform specific behavior).

  4. compact_optional

    A template for creating optional-like object with no space overhead

    Or there's this from 2015: https://github.com/akrzemi1/compact_optional

  5. cmake-init

    The missing CMake project initializer

    Grab cmake-init and you won't even have to think much about how to support clients using CMake.

  6. libCat

    ๐Ÿˆโ€โฌ› A runtime for C++26 w/out libC or POSIX. Smaller binaries, only arena allocators, SIMD, stronger type safety than STL, and value-based errors!

  7. Sevalla

    Deploy and host your apps and databases, now with $50 credit! Sevalla is the PaaS you have been looking for! Advanced deployment pipelines, usage-based pricing, preview apps, templates, human support by developers, and much more!

    Sevalla logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • ๐Ÿš€Announcing conjure_enum - a C++20 enum and typename reflection Library

    1 project | dev.to | 31 Jul 2024
  • Show HN: Conjure_enum โ€“ a C++20 enum and typename reflection Library

    1 project | news.ycombinator.com | 30 Jul 2024
  • Show HN: CXXStateTree โ€“ A modern C++ library for hierarchical state machines

    10 projects | news.ycombinator.com | 6 Jul 2025
  • C++ Game Utility Libraries: for Game Dev Rustaceans

    9 projects | dev.to | 13 Mar 2024
  • Why are strings and IO so complicated?

    13 projects | /r/cpp | 7 Dec 2023

Did you know that C++ is
the 7th most popular programming language
based on number of references?