C++20 module
C++ 20 language and library features backported to C++17.
Files
- file assume_aligned.h
- Contains the definition of muu::
assume_aligned(). - file bit.h
- Bit manipulation functions. C++20's <bit> with extra steps.
- file bit_cast.h
- Contains the definition of muu::
bit_cast(). - file bit_ceil.h
- Contains the definition of muu::
bit_ceil(). - file bit_floor.h
- Contains the definition of muu::
bit_floor(). - file is_constant_evaluated.h
- Contains the definitions of muu::
is_constant_evaluated(), MUU_ IF_ CONSTEVAL and MUU_ IF_ RUNTIME. - file source_location.h
- Contains the definition of muu::
source_location.
Classes
- class muu::source_location
- A backport of C++20's std::
source_location. -
template <typename T, size_t Extent = dynamic_class muu::span
extent, size_t Alignment = 0> - A non-owning view of contiguous elements.
Typedefs
-
template <size_t Alignment>using aligned_byte_span = span<std::
byte, dynamic_extent, Alignment> - Convenience alias for
span<std::
.byte, dynamic_extent, Alignment> -
using byte_span = span<std::
byte> - Convenience alias for
span<std::
.byte> -
using const_byte_span = span<const std::
byte> - Convenience alias for
span<const std::
.byte> - using const_span = span<const T, Extent, Alignment>
- Convenience alias for
span<const T, Extent>
.
Functions
-
auto as_bytes(span<T, E, A> s) -> span<const std::
byte, impl::as_bytes_extent<T, E>> noexcept - Reinterprets a span as an immutable view of the underlying bytes.
-
auto as_writable_bytes(span<T, E, A> s) -> span<std::
byte, impl::as_bytes_extent<T, E>> noexcept - Reinterprets a span as a view of the underlying bytes.
Typedef documentation
#include <muu/span.h>
template <size_t Alignment>
using aligned_byte_span = span<std:: byte, dynamic_extent, Alignment>
Convenience alias for span<std::
.
using const_byte_span = span<const std:: byte>
#include <muu/span.h>
#include <muu/span.h>
using const_span = span<const T, Extent, Alignment>
Convenience alias for span<const T, Extent>
.
Function documentation
#include <muu/span.h>
span<const std:: byte, impl::as_bytes_extent<T, E>> as_bytes(span<T, E, A> s) noexcept
Reinterprets a span as an immutable view of the underlying bytes.
Equivalent to C++20's std::as_bytes.
#include <muu/span.h>
span<std:: byte, impl::as_bytes_extent<T, E>> as_writable_bytes(span<T, E, A> s) noexcept
Reinterprets a span as a view of the underlying bytes.
Equivalent to C++20's std::as_writable_bytes.