Tatooine
bind.h
Go to the documentation of this file.
1#ifndef TATOOINE_BIND_H
2#define TATOOINE_BIND_H
3//==============================================================================
4#include <functional>
5//==============================================================================
6namespace tatooine {
7//==============================================================================
9template <typename F, typename... Args>
10constexpr auto bind(F&& f, Args&&... args) {
11 return [&](auto&&... rest) -> decltype(auto) {
12 return f(std::forward<Args>(args)...,
13 std::forward<decltype(rest)>(rest)...);
14 };
15}
16//==============================================================================
17} // namespace tatooine
18//==============================================================================
19#endif
Definition: algorithm.h:6
constexpr auto bind(F &&f, Args &&... args)
Binds first arguments of f (either all or only partially).
Definition: bind.h:10