feat: add timer calibration
This commit is contained in:
parent
da848544c0
commit
43c87e5904
5 changed files with 144 additions and 5 deletions
|
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "util/utility.h"
|
||||
|
||||
template<typename... Ts>
|
||||
struct overloaded : Ts... {
|
||||
using Ts::operator()...;
|
||||
|
|
@ -7,3 +9,17 @@ struct overloaded : Ts... {
|
|||
|
||||
template<typename... Ts>
|
||||
overloaded(Ts...) -> overloaded<Ts...>;
|
||||
|
||||
template<typename Func, typename... BoundArgs>
|
||||
auto partial(Func func, BoundArgs... bound_args) {
|
||||
return [func, bound_args...](auto&&... call_args) {
|
||||
return func(bound_args..., forward<decltype(call_args)>(call_args)...);
|
||||
};
|
||||
}
|
||||
|
||||
template<typename Type>
|
||||
auto construct() {
|
||||
return [](auto&&... args) {
|
||||
return Type{forward<decltype(args)>(args)...};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue