From 86d8a736ef52eb6ddf8a9a0ea99ff9f3652cff77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Thu, 25 May 2023 13:36:33 +0200 Subject: [PATCH] Help older compilers deal with this --- include/openPMD/Iteration.hpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) 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).