How tartanllama/expected works
Main Components
a) Core Component:
• The single header file expected.hpp which contains the entire implementation
• This as the central component of the system
b) External Dependencies:
• Standard C++ Library components
• Assert mechanism (configurable through TL_ASSERT macro)
c) Testing Framework:
• The comprehensive test suite in the tests directory
• Build system (CMake)
• ┌─────────────────────────────────────┐
• tl::expected<T,E> │
• ┌─────────────┐ ┌─────────────┐ │
• Value │ │ Error │ │
• Type (T) │ │ Type (E) │ │
• ┘ └─────────────┘ │
• ┘
Specific details
┌─────────────────────────────────────────────────┐
• Build & Package System │
• ┌─────────┐ ┌─────────┐ ┌──────────┐ │
• CMake │ │ Vcpkg │ │ Conan │ │
• ┘ └─────────┘ └──────────┘ │
• ┘
┌─────────────────────────────────────────────────┐
• tl::expected<T,E> │
• ┌─────────────┐ ┌──────────────────┐ │
• Value State │ │ Error State │ │
• ┘ └──────────────────┘ │
• ┌─────────────────────────────────────────┐ │
• Functional Extensions │ │
• ● map() ● and_then() │ │
• ● map_error() ● or_else() │ │
• ┘ │
• ┘
┌─────────────────────────────────────────────────┐
• Test Suite │
• ┌────────────┐ ┌────────────┐ ┌──────────┐ │
• Unit Tests │ │ Constexpr │ │ NoExcept │ │
• ┘ └────────────┘ └──────────┘ │
• ┘
Important Notes
• Keep the focus on the template implementation and its functional extensions
• Single-header nature of the library
• Relationship between the core implementation and the test suite
• Build system integration points
• Demonstrate the error handling flow through the functional extensions