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