C/C++ API Reference
Loading...
Searching...
No Matches
pw_span

Oveview

std::span for C++17. Main docs: https://pigweed.dev/pw_span

Submodules

 Cast
 

Classes

class  pw::span< T, Extent >
 

Macros

#define PW_SPAN_ENABLE_ASSERTS   0
 Controls whether pw_span includes asserts for detecting disallowed span operations at runtime.
 
#define _PW_SPAN_ASSERT(arg)
 

Typedefs

template<class ResultT , size_t kSourceExtentBytes>
using pw::internal::SpanFromBytes = span< ResultT,(kSourceExtentBytes==dynamic_extent ? dynamic_extent :kSourceExtentBytes/sizeof(ResultT))>
 

Macro Definition Documentation

◆ PW_SPAN_ENABLE_ASSERTS

#define PW_SPAN_ENABLE_ASSERTS   0

Controls whether pw_span includes asserts for detecting disallowed span operations at runtime.

For C++20 and later, this replaces std::span with the custom implementation in pw_span to ensure bounds-checking asserts have been enabled.

This defaults to disabled because of the significant increase in code size caused by enabling this feature. It's strongly recommended to enable this in debug and testing builds.