EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Loading...
Searching...
No Matches
EmscriptenExtra.hpp
Go to the documentation of this file.
1
9
10#ifndef ECHOMAP_EMSCRIPTENEXTRA_HPP
11#define ECHOMAP_EMSCRIPTENEXTRA_HPP
12
13#if defined(__EMSCRIPTEN__) || defined(__DOXYGEN__)
14
15#include <type_traits>
16
17namespace echomap::web
18{
19
28template <
29 class T,
30 std::enable_if_t<std::is_arithmetic_v<T>>...>
31static constexpr auto abs(
32 T const& x
33) noexcept
34{
35 return x < 0 ? -x : x;
36}
37
38} // namespace echomap::web
39
40#endif // __EMSCRIPTEN__
41
42#endif // ECHOMAP_EMSCRIPTENEXTRA_HPP
static constexpr auto abs(T const &x) noexcept
Constexpr absolute value function for pre-C++23 Emscripten compilers.