LeviLamina
Loading...
Searching...
No Matches
move_only_function.h
1
#pragma once
2
3
#include "mc/platform/brstd/detail/function.h"
4
5
namespace
brstd {
6
7
template
<
class
Signature>
8
class
move_only_function
9
:
public
detail::function::function_invoke
<detail::function::DerivedType::MoveOnly, Signature> {
10
using
base
=
detail::function::function_invoke<detail::function::DerivedType::MoveOnly, Signature>
;
11
12
public
:
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
;
17
move_only_function
(
move_only_function
const
&) =
delete
;
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
brstd::detail::function::function_invoke_base
Definition
function.h:243
brstd::detail::function::function_invoke
Definition
function.h:448
brstd::move_only_function
Definition
move_only_function.h:9
src
mc
platform
brstd
move_only_function.h
Generated on Sat Apr 26 2025 05:55:49 for LeviLamina by
1.12.0