Skip to content

Commit 86d8a73

Browse files
committed
Help older compilers deal with this
1 parent ced895b commit 86d8a73

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

include/openPMD/Iteration.hpp

+14-5
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,27 @@ namespace internal
126126
*/
127127
class Iteration : public CustomHierarchy
128128
{
129-
template <typename T, typename T_key, typename T_container>
130-
friend class Container;
129+
public:
130+
using IterationIndex_t = uint64_t;
131+
132+
/*
133+
* Some old compilers have trouble with befriending the entire Container
134+
* template here, so we restrict it
135+
* to Container<Iteration, IterationIndex_t>, more is not needed anyway.
136+
*
137+
* E.g. on gcc-7:
138+
* > error: specialization of 'openPMD::Container<openPMD::CustomHierarchy>'
139+
* > after instantiation
140+
* > friend class Container;
141+
*/
142+
friend class Container<Iteration, IterationIndex_t>;
131143
friend class Series;
132144
friend class WriteIterations;
133145
friend class SeriesIterator;
134146

135-
public:
136147
Iteration(Iteration const &) = default;
137148
Iteration &operator=(Iteration const &) = default;
138149

139-
using IterationIndex_t = uint64_t;
140-
141150
/**
142151
* @tparam T Floating point type of user-selected precision (e.g. float,
143152
* double).

0 commit comments

Comments
 (0)