Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LHCb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LHCb
LHCb
Merge requests
!3533
add move constructor to SynchronizedValue
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
add move constructor to SynchronizedValue
allow-move-ctor-SynchronizedValue
into
master
Overview
1
Commits
1
Pipelines
3
Changes
1
Merged
Gerhard Raven
requested to merge
allow-move-ctor-SynchronizedValue
into
master
2 years ago
Overview
1
Commits
1
Pipelines
3
Changes
1
Expand
0
0
Merge request reports
Compare
master
version 1
99a57850
2 years ago
master (base)
and
latest version
latest version
27a7f7b7
1 commit,
2 years ago
version 1
99a57850
1 commit,
2 years ago
1 file
+
18
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Kernel/LHCbKernel/include/Kernel/SynchronizedValue.h
+
18
−
0
Options
@@ -59,6 +59,24 @@ namespace LHCb::cxx {
return
*
this
;
}
SynchronizedValue
(
SynchronizedValue
&&
rhs
)
{
static_assert
(
std
::
is_default_constructible_v
<
Value
>
);
// bound to hold, as otherwise we wouldn't get this
// far... so for 'documnentation purpose' really (C++20:
// turn into a `requires` clause )...
static_assert
(
std
::
is_move_assignable_v
<
Value
>
);
auto
lock
=
std
::
scoped_lock
{
rhs
.
m_mtx
,
m_mtx
};
m_obj
=
std
::
move
(
rhs
.
m_obj
);
}
SynchronizedValue
&
operator
=
(
SynchronizedValue
&&
rhs
)
{
static_assert
(
std
::
is_move_assignable_v
<
Value
>
);
if
(
this
!=
&
rhs
)
{
auto
lock
=
std
::
scoped_lock
{
rhs
.
m_mtx
,
m_mtx
};
m_obj
=
std
::
move
(
rhs
.
m_obj
);
}
return
*
this
;
}
template
<
typename
F
,
typename
...
Args
,
typename
=
std
::
enable_if_t
<
std
::
is_invocable_v
<
F
,
Value
&
,
Args
...>
&&
!
std
::
is_invocable_v
<
F
,
const
Value
&
,
Args
...
>>>
Loading