tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
data.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ITERATOR_DATA_HPP
4#define TETL_ITERATOR_DATA_HPP
5
6namespace etl {
7
10template <typename C>
11constexpr auto data(C& c) noexcept(noexcept(c.data())) -> decltype(c.data())
12{
13 return c.data();
14}
15
17template <typename C>
18constexpr auto data(C const& c) noexcept(noexcept(c.data())) -> decltype(c.data())
19{
20 return c.data();
21}
22
24template <typename T, size_t N>
25constexpr auto data(T (&array)[N]) noexcept -> T*
26{
27 return &array[0];
28}
29
30} // namespace etl
31
32#endif // TETL_ITERATOR_DATA_HPP
constexpr auto data(C &c) noexcept(noexcept(c.data())) -> decltype(c.data())
Returns a pointer to the block of memory containing the elements of the container.
Definition data.hpp:11
Definition adjacent_find.hpp:8
A container that encapsulates fixed size arrays.
Definition array.hpp:48