Date: Thu, 07 Aug 2025 14:03:49 -0700
On Thursday, 7 August 2025 12:44:41 Pacific Daylight Time Oliver Hunt via Std-
Proposals wrote:
> Adding new pointer based apis just is not something we can reasonably accept
> at this point, and std::span is exactly equivalent to bounded pointers -
> can you point to your code (or on godbolt?) showing the difference in
> codegen?
The Windows ABI passes anything not a primitive by implicit const-ref. That
applies to spans.
However, that's no reason to design APIs like that. Vendors targeting Windows
can make the API inline and break up the span into its component portions to
call an internal, out-of-line function. This may also apply to vendors who
could want to shift the implementation of this function into a lower-level
library that cannot depend on C++ Standard Library types.
Proposals wrote:
> Adding new pointer based apis just is not something we can reasonably accept
> at this point, and std::span is exactly equivalent to bounded pointers -
> can you point to your code (or on godbolt?) showing the difference in
> codegen?
The Windows ABI passes anything not a primitive by implicit const-ref. That
applies to spans.
However, that's no reason to design APIs like that. Vendors targeting Windows
can make the API inline and break up the span into its component portions to
call an internal, out-of-line function. This may also apply to vendors who
could want to shift the implementation of this function into a lower-level
library that cannot depend on C++ Standard Library types.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel Platform & System Engineering
Received on 2025-08-07 21:03:51