std::span::size_bytes(3)
โจ NAME โจ
Okay so this page is std::span::size_bytes(3), from the C++ Standard Libary manual, and the name line is literally std::span::size_bytes - std::span::size_bytes. No notes, she said what she said. ๐
๐ธ Synopsis ๐ธ
constexpr size_type size_bytes() const noexcept; (since C++20)
Returns the size of the sequence in bytes. Thatโs the whole function, bestie. โจ
๐ Parameters ๐
(none) โ literally no parameters, she takes zero arguments and thatโs iconic.
๐ฆ Return value ๐ฆ
The size of the sequence in bytes, i.e., size() * sizeof(element_type). Math but make it fashion. ๐งฎ๐
๐ Example ๐
// Run this code
#include <cstdint>
#include <span>
int main()
{
constexpr static std::int32_t a[]{1, 2, 3, 4, 5};
constexpr static std::span s{a};
static_assert
(
sizeof(int32_t) == 4 &&
std::size(a) == 5 &&
sizeof a == 20 &&
s.size() == 5 &&
s.size_bytes() == 20
);
}
๐ See also ๐
sizeโ returns the number of elements in the sequence (C++20) (public member function).
source/version: http://cppreference.com ยท date: 2024.06.10 ยท page: std::span::size_bytes(3). byeee bestie, go count some bytes ๐ซถ๐
๐ฆ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms