C++ Features and Patterns Used
Page Status
This page is a placeholder. Content coming soon.
Background for contributors who may not be familiar with specific C++20/23 features and patterns used in the codebase.
C++20 features in use:
Concepts:
SupportsTransparencyand others for compile-time constraintsstd::source_location: used in panic diagnostics for automatic file/line captureRanges and views: used throughout for container transformations
C++23 features in use:
std::formatandstd::formatterspecializations (with the criticalauto &ctxnote fromSTYLE.md)std::expected: used in newer code for simple error returnsDeducing
this: where and why it is used
Key patterns:
Move-only types:
ChainableResultis move-only, use case return values usestd::moveTemplate aggregates:
PixelTile<T>,Image<T>,Metatile<T>– parameterized on pixel typeStrong types:
ArtifactKey,ConfigValue<T>– wrapping primitives for type safetyBitmask enums:
Styleflags for text formattingThe
PT_TRY_ASSIGN_CHAIN_ERRmacro: what it expands to
fmtlib notes: mostly migrated to
std::format, butfmt::dynamic_format_arg_storestill needed for runtime variable argument countsReference to
STYLE.mdfor naming conventions, include ordering, and idioms (do not duplicate)
Cross-references: Error Handling and User Diagnostics for the Result/Error types in detail, STYLE.md (external reference)