FastLED 3.10.8
Loading...
Searching...
No Matches
range_access.h
Go to the documentation of this file.
1#pragma once
2
4#include "fl/stl/stdint.h"
5#include "fl/stl/noexcept.h"
6
7namespace fl {
8
9namespace adl_barrier { // see fl/stl/adl_barrier.h
10// fl::begin for arrays
11template <typename T, fl::size N>
12constexpr T* begin(T (&array)[N]) FL_NO_EXCEPT {
13 return array;
14}
15
16// fl::end for arrays
17template <typename T, fl::size N>
18constexpr T* end(T (&array)[N]) FL_NO_EXCEPT {
19 return array + N;
20}
21
22// fl::begin for containers with begin() member function
23template <typename Container>
24constexpr auto begin(Container& c) FL_NO_EXCEPT -> decltype(c.begin()) {
25 return c.begin();
26}
27
28// fl::begin for const containers with begin() member function
29template <typename Container>
30constexpr auto begin(const Container& c) FL_NO_EXCEPT -> decltype(c.begin()) {
31 return c.begin();
32}
33
34// fl::end for containers with end() member function
35template <typename Container>
36constexpr auto end(Container& c) FL_NO_EXCEPT -> decltype(c.end()) {
37 return c.end();
38}
39
40// fl::end for const containers with end() member function
41template <typename Container>
42constexpr auto end(const Container& c) FL_NO_EXCEPT -> decltype(c.end()) {
43 return c.end();
44}
45} // namespace adl_barrier
46
47
48} // namespace fl
Keeps fl's generic templates out of argument-dependent lookup (ADL).
A fixed-size array implementation similar to std::array.
Definition array.h:27
constexpr T * begin(T(&array)[N]) FL_NO_EXCEPT
u8 u8 fract8 blur_amount FL_NO_EXCEPT
Definition blur.h:186
Base definition for an LED controller.