span-lite
« Back to VersTracker
Description:
C++20-like span for C++98, C++11 and later in a single-file header-only library
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: c++ header-only library cpp11 modern-cpp
Install: brew install span-lite
About:
span-lite provides a C++20 std::span implementation for C++98/11/14/17 projects. It offers a type-safe, non-owning view over contiguous sequences of objects. This single-file header-only library enables modern bounds-safe pointer interfaces without requiring a full C++20 standard library.
Key Features:
  • Single-file header-only library
  • Backwards compatible with C++98 and later
  • Feature detection and configuration via preprocessor macros
  • Provides non-owning view of contiguous memory
  • Zero runtime overhead abstraction
Use Cases:
  • Adding span-based APIs to legacy C++ codebases
  • Creating bounds-safe interfaces for raw pointers and arrays
  • Preparing code for future migration to C++20 std::span
Alternatives:
  • gsl::span – Microsoft's GSL includes span but requires linking to the GSL library
  • C++20 std::span – Native standard library solution, but requires modern compiler support
Version History
Detected Version Rev Change Commit