FastLED 3.10.8
Loading...
Searching...
No Matches
noexcept.h
Go to the documentation of this file.
1#pragma once
2
3// Load SDK target definitions before selecting the exception contract. This
4// also makes selection independent of whether FastLED.h was included first.
5#include "platforms/is_platform.h" // IWYU pragma: keep
6
7#ifndef FL_NO_EXCEPT
8#if defined(FL_IS_ESP)
9#define FL_NO_EXCEPT noexcept
10#define FL_HAS_NOEXCEPT 1
11#else
12#define FL_NO_EXCEPT
13#endif
14#endif
15
16// External overrides retain their existing caller-owned capability contract:
17// define FL_HAS_NOEXCEPT as 1 alongside an override that guarantees no throw.
18// Leave the flag absent for empty or potentially throwing overrides. When an
19// external override omits the flag, the library makes no capability claim.
20// Arbitrary conditional C++ noexcept expressions cannot be evaluated by the
21// preprocessor, so preserve them without attempting token-based classification.
22
23// Destructor-only exception specification. Destructors in ownership chains
24// that only release memory can opt in without re-enabling FL_NO_EXCEPT across
25// platforms for unrelated functions.
26#ifndef FL_DTOR_NOEXCEPT
27#define FL_DTOR_NOEXCEPT noexcept
28#endif
29
30// FastLED assumes nonthrowing operations, including user callbacks. System
31// exception frames and crash diagnostics remain owned by the platform.