2025-01-13 18:11:16 +01:00
|
|
|
#ifndef UTILS_H
|
|
|
|
#define UTILS_H
|
|
|
|
|
2025-01-17 10:40:54 +01:00
|
|
|
/**
|
|
|
|
* @brief A utility structure for enabling function overloading with template-based classes.
|
|
|
|
* see : https://stackoverflow.com/a/64018031
|
|
|
|
*/
|
2025-01-13 18:11:16 +01:00
|
|
|
template<class... Ts>
|
|
|
|
struct overload : Ts... {
|
|
|
|
using Ts::operator()...;
|
|
|
|
};
|
2025-01-17 10:40:54 +01:00
|
|
|
/**
|
|
|
|
* @brief Deduction guide for the `overload` template.
|
|
|
|
* see : https://stackoverflow.com/a/64018031
|
|
|
|
*/
|
2025-01-13 18:11:16 +01:00
|
|
|
template<class... Ts>
|
|
|
|
overload(Ts...) -> overload<Ts...>;
|
|
|
|
|
|
|
|
#endif // UTILS_H
|