Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
result.h File Reference

Umbrella header for Result<T> type and related utilities. More...

#include "result/core.h"
#include "result/utilities.h"
#include "result/compat.h"
Include dependency graph for result.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Detailed Description

Umbrella header for Result<T> type and related utilities.

This is the main include file for the Result pattern. Including this header provides access to all Result-related types and functions.

The Result pattern has been consolidated into 3 logical headers:

// Core types: Result<T>, Optional<T>, error_info
// Utilities: factory functions, exception conversion, macros
// Compatibility: legacy error code aliases
Backward compatibility layer for error codes.
Consolidated core types for Result<T> pattern.
Utility functions and macros for Result<T> pattern.

Thread Safety:

  • Result<T> objects are NOT thread-safe for concurrent modification.
  • Multiple threads may safely read the same Result<T> if no thread modifies it.
  • Helper functions are thread-safe as they don't modify global state.
  • If sharing Result<T> across threads, users must provide synchronization.
  • Best practice: Use Result<T> as return values; avoid shared mutable access.

Definition in file result.h.