Skip to content

Releases: Hackerl/zero

v1.2.0

22 Apr 07:49

Choose a tag to compare

Breaking Changes

async: Revamped Future/Promise API

  • Introduced Executor interface and InlineExecutor singleton; callbacks are now dispatched through the bound executor instead of being called inline.
  • Introduced SemiFuture<T, E>: a future without a bound executor. Promise::getFuture() now returns SemiFuture; callers must call .via(executor) to obtain a Future.
  • chain() renamed to contract(); it now accepts an Executor and returns Contract<T, E> (std::pair<Promise, Future>). The executor propagates through the entire callback chain.
  • Added Future::resolved(), Future::rejected(), SemiFuture::resolved(), SemiFuture::rejected() static factory methods for constructing immediately-ready futures.

meta: Namespace and header reorganization

  • Renamed namespace zero::traitszero::meta; headers moved from include/zero/traits/ to include/zero/meta/.
  • Split into separate meta/type_traits.h and meta/concepts.h headers.
  • Type traits now use PascalCase with an Is prefix for bool variable templates (e.g., is_specialization_vIsSpecialization).
  • Removed applicable traits; use requires expressions directly instead.
  • Removed zero::Interface base class; virtual destructors are now defined explicitly per class.

filesystem / strings: Flattened header paths

  • include/zero/filesystem/fs.hinclude/zero/filesystem.h
  • include/zero/strings/strings.hinclude/zero/strings.h
  • Directory iteration: replaced the iterator-emulating NoExcept type with a pull-based next() API returning std::expected<std::optional<DirectoryEntry>>, making error propagation explicit.

Infallible APIs now throw instead of returning std::expected

  • The following APIs now throw on failure instead of returning a typed error code: zero::os::process::self(), zero::os::process::all(), zero::os::net::interfaces(), zero::os::stat::cpu(), zero::os::stat::memory(), zero::os::hostname(), zero::os::pipe(), Resource::isInheritable(), Resource::duplicate(), Resource::setInheritable(), zero::filesystem::temporaryDirectory(), zero::filesystem::absolute(), zero::filesystem::currentPath(), and several internal procfs / PEB parsing helpers.
  • cmdline: scan() and parseValue() now throw instead of returning std::expected.
  • log: IProvider interface methods now throw instead of returning std::expected.

promise

  • Empty-range handling now throws instead of triggering an assertion.
  • When aggregating futures whose result type is void, the placeholder in the result tuple changed from std::nullptr_t to std::monostate.

New Features

  • promise: Promise chains now support exception handling — .then/.fail/.finally callbacks may throw; exceptions are captured and propagated through the chain. (1368a85)
  • error: New zero::error::capture(f) helper that invokes a callable and converts any thrown exception into std::unexpected, bridging exception-based and std::expected-based code. (0cfe644)
  • filesystem: readDirectory and walkDirectory now have overloads accepting a DirectoryOptions argument. (e0e5b7b)

Bug Fixes

  • Windows / net: Several WinSock APIs return error codes directly rather than setting the value retrieved by GetLastError(); error retrieval is now correct for these APIs. (abd892a)
  • Windows / process: TerminateProcess may return ERROR_ACCESS_DENIED when the target process has already exited; this is now treated as a success. (f01dbf9)
  • macOS / process: sysctl(KERN_PROCARGS2) does not report an error when the buffer is too small; the call is now issued twice — once to obtain the required size, once to fetch the data. If the target process calls exec() between the two calls, the new program's argument area may exceed the estimated size; the fetch is now retried with a larger buffer when this is detected. (e29f63b, 4bb83e0)
  • macOS / process: Process::envs() no longer throws when the KERN_PROCARGS2 buffer ends immediately after the last environment variable's null terminator; buffer exhaustion is now treated as a valid termination condition. (844bc86)
  • meta: FunctionTraits reference specializations now strip cv-qualifiers before deducing the function type, fixing incorrect trait results for const/volatile references. (5a78c7b)

Build

  • CMake minimum required version updated; platform detection logic simplified. (fa59675)

v1.1.0

28 Feb 13:18

Choose a tag to compare

chore: bump version to 1.1.0