mirror of
https://github.com/QRouland/UTPass.git
synced 2025-01-24 15:46:40 +00:00
20 lines
445 B
C++
20 lines
445 B
C++
#ifndef UTILS_H
|
|
#define UTILS_H
|
|
|
|
/**
|
|
* @brief A utility structure for enabling function overloading with template-based classes.
|
|
* see : https://stackoverflow.com/a/64018031
|
|
*/
|
|
template<class... Ts>
|
|
struct overload : Ts... {
|
|
using Ts::operator()...;
|
|
};
|
|
/**
|
|
* @brief Deduction guide for the `overload` template.
|
|
* see : https://stackoverflow.com/a/64018031
|
|
*/
|
|
template<class... Ts>
|
|
overload(Ts...) -> overload<Ts...>;
|
|
|
|
#endif // UTILS_H
|