Skip to content

Commit

Permalink
Help older compilers deal with this
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed May 25, 2023
1 parent ced895b commit 86d8a73
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions include/openPMD/Iteration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,27 @@ namespace internal
*/
class Iteration : public CustomHierarchy
{
template <typename T, typename T_key, typename T_container>
friend class Container;
public:
using IterationIndex_t = uint64_t;

/*
* Some old compilers have trouble with befriending the entire Container
* template here, so we restrict it
* to Container<Iteration, IterationIndex_t>, more is not needed anyway.
*
* E.g. on gcc-7:
* > error: specialization of 'openPMD::Container<openPMD::CustomHierarchy>'
* > after instantiation
* > friend class Container;
*/
friend class Container<Iteration, IterationIndex_t>;
friend class Series;
friend class WriteIterations;
friend class SeriesIterator;

public:
Iteration(Iteration const &) = default;
Iteration &operator=(Iteration const &) = default;

using IterationIndex_t = uint64_t;

/**
* @tparam T Floating point type of user-selected precision (e.g. float,
* double).
Expand Down

0 comments on commit 86d8a73

Please sign in to comment.