diff --git a/include/openPMD/Iteration.hpp b/include/openPMD/Iteration.hpp index 5eb5f3a18c..b19359b8c2 100644 --- a/include/openPMD/Iteration.hpp +++ b/include/openPMD/Iteration.hpp @@ -126,18 +126,27 @@ namespace internal */ class Iteration : public CustomHierarchy { - template - 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, more is not needed anyway. + * + * E.g. on gcc-7: + * > error: specialization of 'openPMD::Container' + * > after instantiation + * > friend class Container; + */ + friend class Container; 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).