Skip to main content
The C++ adapter is a header-only library that wraps the C ABI in RAII types and std::span. No separate build step is required.

Installation

Copy zinc.hpp into your project:
Link against libzinc_core at build time:

SharedRegion

create

Creates a new region. Throws std::system_error on failure. The error code maps to the negated Zinc error code.

open

Opens an existing region.

bytes

Returns a std::span<std::byte> backed by the shared memory mapping. No copying occurs.
A const overload is available for read-only access:

capacity

notify

wait

Returns true on notification, false on timeout.

RAII semantics

SharedRegion is move-only. It cannot be copied. The handle closes automatically when it goes out of scope.

Complete example

Requirements

  • C++20 or later (for std::span)
  • A C++ compiler that supports std::span (GCC 10+, Clang 7+, MSVC 2019 16.10+)
  • The zinc_core shared library on the library search path at runtime