Draft: Migrate Nektar++ to use C++17 language features
Issue/feature addressed
Transitioning to a more modern C++ standard is important to improve interoperability with other libraries and application development. Furthermore, there are a number of boost libraries / capabilities which are now part of the standard and can reduce our dependence on Boost.
Proposed solution
This MR updates the source to use a number of C++17 features, including std::filesystem, std::thread, nested namespaces and aligned allocation.
Implementation
The following has been implemented:
-
Usemerged in !1556 (merged)clang-tidyto refactor nested namespaces and also fix places in the code where we have if statements without braces -
In the process of the above, a number of non-compiled files were detected and removed.moved to !1672 (merged)PanditGilesDemir03.cppcell model in CardiacEPSolver was re-added to compilation list. -
Replacemerged in !1673 (merged)boost::randomwith<random> -
Replacemerged in !1674 (merged)boost::filesystemwith<filesystem>, or<experimental/filesystem>on older versions of gcc (minimum supported is now gcc 6). AddedFilesystem.hppto LibUtilities to give consistent definition offsnamespace. -
Usemoved to !1675 (closed)std::aligned_allocandstd::aligned_freeinstead ofboost::alignment -
A few places have replacedmoved to !1684 (merged) and !1683 (merged) (and done throughout the library)boost::ignore_unusedwith[[maybe_unused]]attribute. -
Replacemoved to !1687 (merged)boost::threadwith<thread> -
Replacemerged in !1674 (merged)boost::system::errcwithstd::errc
Tests
No new tests have been added, but existing ones are running through the pipeline.
Notes
Although the diff here is very large, most changes are very minor and related to the nested namespaces. Most changes in this branch focus on the LibUtilities library.
Checklist
-
Functions and classes, or changes to them, are documented.
- [ ] User guide/documentation is updated. -
Changelog is updated.
- [ ] Suitable tests added for new functionality. -
Contributed code is correctly formatted. (See the contributing guidelines).
- [ ] License added to any new files. -
No extraneous files have been added (e.g. compiler output or test data files).
Warning
On the 19.07 the code formatting (code style) was standardised using clang-format, over the whole Nektar++ code. This means changes in your branch will conflict with formatting changes on the master branch. To resolve these conflicts , see
#295 (closed)