LeviLamina
Loading...
Searching...
No Matches
move_only_function.h
1#pragma once
2
3#include "mc/platform/brstd/detail/function.h"
4
5namespace brstd {
6
7template <class Signature>
9: public detail::function::function_invoke<detail::function::DerivedType::MoveOnly, Signature> {
11
12public:
13 using base::base;
14 using base::operator();
15 move_only_function(move_only_function&&) noexcept = default;
16 move_only_function& operator=(move_only_function&&) noexcept = default;
18 move_only_function& operator=(move_only_function const&) = delete;
19 template <class F>
20 requires std::is_constructible_v<move_only_function, F>
21 move_only_function& operator=(F&& f) {
22 *this = move_only_function{std::forward<F>(f)};
23 return *this;
24 }
25 friend void swap(move_only_function& f1, move_only_function& f2) noexcept { f1.swap(f2); }
26};
27} // namespace brstd
Definition move_only_function.h:9