cpp-gsl
« Back to VersTracker
Description:
Microsoft's C++ Guidelines Support Library
Type: Formula  |  Latest Version: 4.2.1@0  |  Tracked Since: Dec 17, 2025
Links: Homepage  |  @MSFTDevCpp  |  formulae.brew.sh
Category: Developer tools
Tags: c++ guidelines memory-safety header-only microsoft
Install: brew install cpp-gsl
About:
cpp-gsl provides types and utilities that implement the C++ Core Guidelines, particularly focusing on lifetime safety and bounds checking. It offers modern C++ constructs like `gsl::span` for safe array access and `gsl::owner<T>` for explicit ownership tracking. This library helps developers write safer, more expressive code by catching common memory errors at compile-time or runtime.
Key Features:
  • Bounds-checked span and spanstream types
  • Owner pointers for explicit ownership semantics
  • Expects/Ensures macros for contract programming
  • Lightweight, header-only implementation
  • Zero-overhead abstractions where possible
Use Cases:
  • Enforcing memory safety in legacy C++ codebases
  • Implementing the C++ Core Guidelines in new projects
  • Replacing raw pointers with safer alternatives
Alternatives:
  • Boost.Outcome – Focuses on error handling rather than lifetime safety
  • Standard Library <span> – C++20 feature; GSL provides broader guidelines support
License: MIT
Bottles available for: all
Version History
Detected Version Rev Change Commit
Dec 23, 2024 12:18am 0 VERSION_BUMP f3552042