19#include "pw_preprocessor/compiler.h"
40template <
typename T,
typename A,
typename B>
64template <
typename T,
typename Inc>
66 std::optional<T> result =
67 CheckedAdd<std::remove_reference_t<
decltype(base)>>(base, inc);
92template <
typename T,
typename A,
typename B>
116template <
typename T,
typename Dec>
118 std::optional<T> result =
119 CheckedSub<std::remove_reference_t<
decltype(base)>>(base, dec);
144template <
typename T,
typename A,
typename B>
#define PW_SUB_OVERFLOW(a, b, out)
Definition: compiler.h:294
#define PW_ADD_OVERFLOW(a, b, out)
Definition: compiler.h:282
#define PW_MUL_OVERFLOW(a, b, out)
Definition: compiler.h:304
Provides basic helpers for reading and writing UTF-8 encoded strings.
Definition: alignment.h:27
constexpr std::optional< T > CheckedAdd(A a, B b)
Definition: checked_arithmetic.h:41
constexpr bool CheckedDecrement(T &base, Dec dec)
Definition: checked_arithmetic.h:117
constexpr std::optional< T > CheckedSub(A a, B b)
Definition: checked_arithmetic.h:93
constexpr std::optional< T > CheckedMul(A a, B b)
Definition: checked_arithmetic.h:145
constexpr bool CheckedIncrement(T &base, Inc inc)
Definition: checked_arithmetic.h:65