Welcome to dross

dross is a modern C++23 library providing fundamental building blocks for applications, designed to be a general-purpose library similar to Boost with a focus on:

  • Zero external dependencies - Only requires the standard library

  • Modern C++ design - Leveraging C++23 features throughout

  • Error handling without exceptions - Using std::optional and std::expected

  • ABI stability - Through careful use of the Pimpl idiom

  • Comprehensive type system - Dynamic types with value semantics

Getting Started

New to dross? Start here with installation instructions and a quick tutorial.

User Guide

Learn how to use dross effectively with in-depth guides and best practices.

API Reference

Complete API documentation for all dross modules and classes.

Examples

See dross in action with practical examples and use cases.

Core Modules

Type System

The dross type system provides dynamic typing with strong value semantics:

#include <dross/value.h>

using namespace dross;

// Create various types
value v1 = 42;                          // number
value v2 = "hello world";               // string
value v3 = array{1, 2, 3};             // array
value v4 = dictionary{{"key", "value"}}; // dictionary
value v5 = true;                        // boolean

// Type checking
if (v1.is_number()) {
    auto n = v1.as_number();
    std::cout << "Number: " << n << std::endl;  // Direct stream output
}

Platform Utilities

Cross-platform utilities for common operations:

#include <dross/environment.h>
#include <dross/path.h>
#include <dross/xdg.h>

// Environment variables
auto home = environment::get("HOME");

// Path operations
auto config_dir = path::join(home.value_or("/tmp"), ".config");

// XDG Base Directory support
auto data_home = xdg::data_home();

Features

  • Dynamic Type System: Polymorphic value type using std::variant

  • Unicode Support: Built-in Unicode-aware string handling

  • Arbitrary Precision: Number type with string-based storage

  • Error Handling: Consistent use of std::optional and std::expected

  • Modern C++: Concepts, ranges, three-way comparison, and more

  • Platform Utilities: Cross-platform environment and filesystem operations

Installation

dross can be built using CMake:

# Clone the repository
git clone https://github.com/skipbit/dross.git
cd dross

# Configure and build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

# Run tests
cd build && ctest

See Getting Started for detailed installation instructions.

Contributing

We welcome contributions! Please see our Contributing to dross guide for details on:

  • Code style and conventions

  • Testing requirements

  • Submitting pull requests

  • Reporting issues

License

dross is released under the MIT License. See the LICENSE file for details.

Indices and tables