Skip to content

Repository files navigation

ccc

English | 简体中文


ccc is a C++ utility library that provides modern C++ tools, including pipe operators, monadic expected, and more.

Features

  • Header-only and module-supported design for maximum flexibility.
  • C++14 and later support (some features require C++17 or C++20).

Quick Start

Include the library

#include "ccc/all.hh"

Or, for specific components:

#include "ccc/expected.hh"
#include "ccc/pipe_operator_helper.hh"

When using C++20 modules (if configured):

import ccc;  // import all
import ccc.expected;  // import expected component only

Documentation

  • ccc.utility - Utility tools that implement higher-version C++ STL features in lower C++ standards
  • ccc.pipe_operator_helper - Pipe-style function invocation helpers
  • ccc.expected - Monadic expected with optional criterion support
  • ccc.inplace - Stack-allocated, compile-time fixed-capacity "in-place" containers
  • ccc.resource_guard - RAII-based resource management with defer, try_finally, and with patterns
  • ccc.when - Generalized switch-like expression inspired by Kotlin's when

Building

This project uses CMake. To build:

cmake -S . -B build
cmake --build build

For module support, configure with:

cmake -DCCC_USE_CPP_MODULES=ON ..

Testing

Run tests with:

cmake -S . -B build -DCCC_BUILD_TESTS=ON
cmake --build build
cd build && ctest .

Building with mcpp

This project can also be built with mcpp for C++23 module-based builds:

mcpp build         # Build the library (module mode)
mcpp run -p test   # Build and run all tests
mcpp pack          # Package the release artifact

License

This project is licensed under the MIT License.

About

A collection of useful C++ libraries.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages