tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
operator.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_NEW_OPERATOR_HPP
4#define TETL_NEW_OPERATOR_HPP
5
8
9// Some parts of the new header are declared in the global namespace. To avoid
10// ODR violations, we include the header <new> if it is available.
11#if __has_include(<new>)
12 #include <new>
13#else
14
19[[nodiscard]] auto operator new(etl::size_t count, void* ptr) noexcept -> void*
20{
21 etl::ignore_unused(count);
22 return ptr;
23}
24
29[[nodiscard]] auto operator new[](etl::size_t count, void* ptr) noexcept -> void*
30{
31 etl::ignore_unused(count);
32 return ptr;
33}
34
35#endif
36
37#endif // TETL_NEW_OPERATOR_HPP
constexpr auto ignore_unused(Types &&...) -> void
Explicitly ignore arguments or variables.
Definition ignore_unused.hpp:17
TETL_BUILTIN_SIZET size_t
etl::size_t is the unsigned integer type of the result of the sizeof operator.
Definition size_t.hpp:14