From f71c1d31e838ee408a0f9fe4778cb9fe773ae374 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Thu, 26 May 2022 23:00:38 +0200 Subject: [PATCH] Move function definitions inline to fix compiler warnings --- include/deal.II/grid/grid_tools.h | 78 ++++++++++++++----------------- 1 file changed, 34 insertions(+), 44 deletions(-) diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index 6562abaa9a..028b41f0fe 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -3324,7 +3324,23 @@ namespace GridTools */ template void - save(Archive &ar, const unsigned int version) const; + save(Archive &ar, const unsigned int) const + { + // Implement the code inline as some compilers do otherwise complain + // about the use of a deprecated interface. + Assert(cell_ids.size() == data.size(), + ExcDimensionMismatch(cell_ids.size(), data.size())); + // archive the cellids in an efficient binary format + const std::size_t n_cells = cell_ids.size(); + ar & n_cells; + for (const auto &id : cell_ids) + { + CellId::binary_type binary_cell_id = id.template to_binary(); + ar & binary_cell_id; + } + + ar &data; + } /** * Read the data of this object from a stream for the purpose of @@ -3334,7 +3350,23 @@ namespace GridTools */ template void - load(Archive &ar, const unsigned int version); + load(Archive &ar, const unsigned int) + { + // Implement the code inline as some compilers do otherwise complain + // about the use of a deprecated interface. + std::size_t n_cells; + ar & n_cells; + cell_ids.clear(); + cell_ids.reserve(n_cells); + for (unsigned int c = 0; c < n_cells; ++c) + { + CellId::binary_type value; + ar & value; + cell_ids.emplace_back(value); + } + ar &data; + } + #ifdef DOXYGEN /** @@ -4279,48 +4311,6 @@ namespace GridTools - template - template - void - CellDataTransferBuffer::save(Archive &ar, - const unsigned int /*version*/) const - { - Assert(cell_ids.size() == data.size(), - ExcDimensionMismatch(cell_ids.size(), data.size())); - // archive the cellids in an efficient binary format - const std::size_t n_cells = cell_ids.size(); - ar & n_cells; - for (const auto &id : cell_ids) - { - CellId::binary_type binary_cell_id = id.template to_binary(); - ar & binary_cell_id; - } - - ar &data; - } - - - - template - template - void - CellDataTransferBuffer::load(Archive &ar, - const unsigned int /*version*/) - { - std::size_t n_cells; - ar & n_cells; - cell_ids.clear(); - cell_ids.reserve(n_cells); - for (unsigned int c = 0; c < n_cells; ++c) - { - CellId::binary_type value; - ar & value; - cell_ids.emplace_back(value); - } - ar &data; - } - - namespace internal { template