thread
Brett 2024-06-02 22:13:20 -04:00
parent a18c114cec
commit 94bd73d942
2 changed files with 21 additions and 5 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.25)
project(blt-gp VERSION 0.0.4)
project(blt-gp VERSION 0.0.5)
option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF)
option(ENABLE_UBSAN "Enable the ub sanitizer" OFF)

View File

@ -30,11 +30,11 @@ namespace blt::gp
{
};
template<typename Return, typename Args>
template<typename Return, typename... Args>
class operation
{
public:
using function_t = std::function<Return(blt::span<Args>)>;
using function_t = std::function<Return(Args...)>;
operation(const operation& copy) = default;
@ -48,8 +48,8 @@ namespace blt::gp
func = functor;
} else
{
func = [&functor](blt::span<Args> args) {
return functor(args);
func = [&functor](Args... args) {
return functor(args...);
};
}
}
@ -57,10 +57,26 @@ namespace blt::gp
explicit operation(function_t&& functor): func(std::move(functor))
{}
inline Return operator()(Args... args)
{
return func(args...);
}
inline Return operator()(blt::span<void*> args)
{
}
private:
function_t func;
};
template<typename Return, typename Args>
class operations
{
};
}