Skip to content

feat: add std::span support for C++20 builds - #99

Open
k-wasniowski wants to merge 3 commits into
cisco:v1from
k-wasniowski:sframe-v1-spanify
Open

k-wasniowski wants to merge 3 commits into
cisco:v1from
k-wasniowski:sframe-v1-spanify

Conversation

@k-wasniowski

Copy link
Copy Markdown
Contributor

Add std::span support for C++20 builds

Summary

Uses std::span for the public byte-view types when building with C++20 and retains gsl_lite::span as the fallback for older language standards.

This backports the span compatibility layer from the main branch to the v1 branch.

Changes

  • Added include/sframe/span.h to select the available span implementation:
    • std::span when supported by the standard library.
    • gsl_lite::span for pre-C++20 builds.
  • Updated include/sframe/sframe.h to use the compatibility span alias for input_bytes and output_bytes.
  • Removed the direct public API dependency on the gsl namespace alias.

Compatibility

  • Existing C++11 builds continue to use gsl_lite::span.
  • C++20 consumers use std::span without API changes to input_bytes or output_bytes.
  • No wire-format or runtime behavior changes.

Validation

  • Built the sframe target using the project's configured C++11 mode.
  • Compiled a C++20 translation unit asserting that input_bytes and output_bytes resolve to the corresponding std::span types.
  • Verified the patch with git diff --check.

Copilot AI lite review requested due to automatic review settings September 23, 2026 07:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Add <stdexcept> directly and test a C++20 consumer build.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity

Open (2)
What changed in this PR

Adds C++20 std::span support while retaining gsl_lite::span for older standards.

Changes:

  • Adds conditional span selection.
  • Updates public byte-view aliases.
  • Removes the direct public gsl namespace dependency.
File Summary
include/​sframe/​span.h Selects std::span or gsl_lite::span; C++20 consumer coverage is missing.
include/​sframe/​sframe.h Uses compatibility span aliases; needs a direct <stdexcept> include.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread include/sframe/sframe.h
Comment thread include/sframe/span.h Outdated
Copilot AI review requested due to automatic review settings September 23, 2026 09:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unresolved ABI, preprocessing compatibility, and header self-containment issues block approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 4 High severity

Open (4)

Comment thread include/sframe/sframe.h
Comment thread include/sframe/span.h Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants