Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Core Modules
dune-istl
Commits
2383e8e3
Commit
2383e8e3
authored
6 years ago
by
Lasse Hinrichsen-Bischoff
Committed by
Simon Praetorius
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[VariableBlockVector] Move constructor and assignment
parent
1efccb40
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!463
Cleanup the VariableBlockVector implementation
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/istl/test/vbvectortest.cc
+5
-0
5 additions, 0 deletions
dune/istl/test/vbvectortest.cc
dune/istl/vbvector.hh
+19
-0
19 additions, 0 deletions
dune/istl/vbvector.hh
with
24 additions
and
0 deletions
dune/istl/test/vbvectortest.cc
+
5
−
0
View file @
2383e8e3
...
...
@@ -87,5 +87,10 @@ int main()
testVectorSpaceOperations
(
v5
);
testScalarProduct
(
v5
);
// check move construction
auto
v6
=
std
::
move
(
v4
);
suite
.
check
(
v6
.
size
()
==
20
,
"Check size of moved-constructed object"
);
suite
.
check
(
v6
[
0
].
size
()
==
8
,
"Check if blocksize of move constructed vector survived"
);
return
suite
.
exit
();
}
This diff is collapsed.
Click to expand it.
dune/istl/vbvector.hh
+
19
−
0
View file @
2383e8e3
...
...
@@ -146,6 +146,25 @@ namespace Dune {
~
VariableBlockVector
()
=
default
;
void
swap
(
VariableBlockVector
&
other
)
{
std
::
swap
(
storage_
,
other
.
storage_
);
std
::
swap
(
block
,
other
.
block
);
std
::
swap
(
initialized
,
other
.
initialized
);
other
.
syncBaseArray
();
syncBaseArray
();
}
// move constructor:
VariableBlockVector
(
VariableBlockVector
&&
tmp
)
{
swap
(
tmp
);
}
// move assignment
VariableBlockVector
&
operator
=
(
VariableBlockVector
&&
tmp
)
{
swap
(
tmp
);
return
*
this
;
}
//! same effect as constructor with same argument
void
resize
(
size_type
_nblocks
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment