Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field* constructor tidy #1385

Merged
merged 10 commits into from
Nov 20, 2018
Merged

Field* constructor tidy #1385

merged 10 commits into from
Nov 20, 2018

Conversation

ZedThree
Copy link
Member

  1. Implement swap and move constructors for Field2D/3D
  2. Default initialises a few things that we were always setting to the same value (useful to allow default initialisation needed for the move ctors)
    • Note: I've changed the default value of Field::boundaryIsSet because this was true when the Field2D/3D constructors were immediately setting it to false.
    • This also means a couple of ctors can just be = default
  3. Lots of noexcept on Array

I'm going to remove checkData from the copy constructors, and possibly Field*::operator=, but I would like to hear some opposing view points to that (see #1361)

Some of these aren't technically true but are really required,
e.g. the destructor calls `Array::release()` which calls
`Array::store()` which might throw. If that happens, the only thing we
can do is abort anyway -- which is what will happen if `noexcept` is
violated.
NOTE: changes default value of `boundaryIsSet` from `true` to
`false`. Shouldn't affect anything though as child classes all
immediately set it to `false` in their ctors
Allows removing `#if CHECK > 0` bracketed code from ctors
@ZedThree ZedThree added this to the BOUT-4.3 milestone Nov 19, 2018
include/bout/array.hxx Outdated Show resolved Hide resolved
include/bout/array.hxx Outdated Show resolved Hide resolved
include/field2d.hxx Outdated Show resolved Hide resolved
include/field3d.hxx Outdated Show resolved Hide resolved
bendudson
bendudson previously approved these changes Nov 19, 2018
@ZedThree ZedThree merged commit 09f389e into next Nov 20, 2018
ZedThree added a commit that referenced this pull request Nov 20, 2018
@ZedThree ZedThree deleted the field-move-ctors branch November 20, 2018 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants