COMMS
Template library intended to help with implementation of communication protocols.
Loading...
Searching...
No Matches
AlignedStorage.h
Go to the documentation of this file.
1//
2// Copyright 2024 - 2026 (C). Alex Robenko. All rights reserved.
3//
4// SPDX-License-Identifier: MPL-2.0
5//
6// This Source Code Form is subject to the terms of the Mozilla Public
7// License, v. 2.0. If a copy of the MPL was not distributed with this
8// file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
12
13#pragma once
14
15#include <cstddef>
16#include <cstdint>
17#include <type_traits>
18
19namespace comms
20{
21
22namespace util
23{
24
25#if COMMS_IS_CPP23
26
27template <std::size_t TSize, std::size_t TAlign>
28using AlignedStorage = std::uint8_t[TSize];
29
30#else // #if COMMS_IS_CPP23
31
32template <std::size_t TSize, std::size_t TAlign>
33using AlignedStorage = typename std::aligned_storage<TSize, TAlign>::type;
34
35#endif // #if COMMS_IS_CPP23
36
37} // namespace util
38
39} // namespace comms
Main namespace for all classes / functions of COMMS library.