some useful functions
This commit is contained in:
parent
c624c91d8b
commit
382e7f6354
1 changed files with 13 additions and 0 deletions
13
include/pit/functions.h
Normal file
13
include/pit/functions.h
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#include <cstddef>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
namespace pit{
|
||||||
|
template<typename T>
|
||||||
|
std::function<T()> generate(T val){
|
||||||
|
return [val](){return val;};
|
||||||
|
}
|
||||||
|
template<typename T, typename... Args>
|
||||||
|
std::function<T(Args...)> accept_args(std::function<T()> f){
|
||||||
|
return [f](Args...){return f();};
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue