tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
as_const.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
3
#ifndef TETL_UTILITY_AS_CONST_HPP
4
#define TETL_UTILITY_AS_CONST_HPP
5
6
#include <
etl/_type_traits/add_const.hpp
>
7
8
namespace
etl
{
9
11
template
<
typename
T>
12
[[nodiscard]]
constexpr
auto
as_const
(T& t)
noexcept
-> add_const_t<T>&
13
{
14
return
t;
// NOLINT(bugprone-return-const-ref-from-parameter)
15
}
16
17
template
<
typename
T>
18
constexpr
auto
as_const
(T
const
&&) ->
void
=
delete
;
19
20
}
// namespace etl
21
22
#endif
// TETL_UTILITY_AS_CONST_HPP
add_const.hpp
etl
Definition
adjacent_find.hpp:8
etl::as_const
constexpr auto as_const(T &t) noexcept -> add_const_t< T > &
Forms lvalue reference to const type of t.
Definition
as_const.hpp:12
include
etl
_utility
as_const.hpp
Generated on Sat Mar 8 2025 16:19:59 for tetl by
1.14.0