##// END OF EJS Templates
Updated TS lib...
Updated TS lib Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r84:483146a07a5f
r88:4e4ec6844f70
Show More
cpp_utils.h
37 lines | 1.8 KiB | text/x-c | CLexer
Added cpp_utils header to host cpp tricks...
r38 #ifndef CPP_UTILS_H
#define CPP_UTILS_H
Mostly working Spectrograms...
r84 #include <functional>
#include <tuple>
Added cpp_utils header to host cpp tricks...
r38 #include <type_traits>
Mostly working Spectrograms...
r84 template<class...> using void_t = void;
Added cpp_utils header to host cpp tricks...
r38
Mostly working Spectrograms...
r84 #define HAS_METHOD(method) \
template<class T, class = void> struct _has_##method : std::false_type \
{}; \
\
template<class T> \
struct _has_##method< \
T, void_t<std::is_member_function_pointer<decltype(&T::method)>>> \
: std::true_type \
{}; \
\
template<class T> \
static inline constexpr bool has_##method = _has_##method<T>::value;
Added cpp_utils header to host cpp tricks...
r38
Mostly working Spectrograms...
r84 // taken from here https://www.fluentcpp.com/2017/10/27/function-aliases-cpp/
#define ALIAS_TEMPLATE_FUNCTION(highLevelF, lowLevelF) \
template<typename... Args> \
inline auto highLevelF(Args&&... args) \
->decltype(lowLevelF(std::forward<Args>(args)...)) \
{ \
return lowLevelF(std::forward<Args>(args)...); \
}
[CPP utils] Added function alias macro...
r39
Mostly working Spectrograms...
r84 template<typename T> constexpr T diff(const std::pair<T, T>& p)
{
return p.second - p.first;
}
Added cpp_utils header to host cpp tricks...
r38
#endif // CPP_UTILS_H