Skip to content

Commit e0304ab

Browse files
committed
gcc-4.8 fix
1 parent 9d9b44e commit e0304ab

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

include/boost/histogram/histogram_impl_dynamic.hpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -327,34 +327,38 @@ class histogram<Dynamic, Axes, Storage> {
327327
template <unsigned D>
328328
inline void xlin_w(std::size_t &, std::size_t &, double &) const {}
329329

330-
template <unsigned D, typename... Rest>
331-
inline void xlin_w(std::size_t &idx, std::size_t &stride, double &x,
332-
weight &&w, Rest &&... rest) const {
333-
x = w.value;
330+
template <unsigned D, typename First, typename... Rest>
331+
inline typename enable_if<is_same<First, weight>>::type
332+
xlin_w(std::size_t &idx, std::size_t &stride, double &x, First &&first,
333+
Rest &&... rest) const {
334+
x = first.value;
334335
return xlin_w<D>(idx, stride, x, std::forward<Rest>(rest)...);
335336
}
336337

337338
template <unsigned D, typename First, typename... Rest>
338-
inline void xlin_w(std::size_t &idx, std::size_t &stride, double &x,
339-
First &&f, Rest &&... rest) const {
340-
apply_visitor(xlin_visitor<First>{idx, stride, std::forward<First>(f)},
339+
inline typename disable_if<is_same<First, weight>>::type
340+
xlin_w(std::size_t &idx, std::size_t &stride, double &x, First &&first,
341+
Rest &&... rest) const {
342+
apply_visitor(xlin_visitor<First>{idx, stride, std::forward<First>(first)},
341343
axes_[D]);
342344
return xlin_w<D + 1>(idx, stride, x, std::forward<Rest>(rest)...);
343345
}
344346

345347
template <unsigned D>
346348
inline void xlin_n(std::size_t &, std::size_t &, unsigned &) const {}
347349

348-
template <unsigned D, typename... Rest>
349-
inline void xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x,
350-
count &&c, Rest &&... rest) const {
351-
x = c.value;
350+
template <unsigned D, typename First, typename... Rest>
351+
inline typename enable_if<is_same<First, count>>::type
352+
xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x, First &&first,
353+
Rest &&... rest) const {
354+
x = first.value;
352355
return xlin_n<D>(idx, stride, x, std::forward<Rest>(rest)...);
353356
}
354357

355358
template <unsigned D, typename First, typename... Rest>
356-
inline void xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x,
357-
First &&f, Rest &&... rest) const {
359+
inline typename disable_if<is_same<First, count>>::type
360+
xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x, First &&f,
361+
Rest &&... rest) const {
358362
apply_visitor(xlin_visitor<First>{idx, stride, std::forward<First>(f)},
359363
axes_[D]);
360364
return xlin_n<D + 1>(idx, stride, x, std::forward<Rest>(rest)...);

include/boost/histogram/histogram_impl_static.hpp

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -238,20 +238,18 @@ class histogram<Static, Axes, Storage> {
238238
inline void xlin_w(std::size_t &, std::size_t &, double &) const {}
239239

240240
template <unsigned D, typename First, typename... Rest>
241-
inline
242-
typename disable_if<is_same<First, weight>>::type
243-
xlin_w(std::size_t &idx, std::size_t &stride, double &x,
244-
First &&first, Rest &&... rest) const {
241+
inline typename disable_if<is_same<First, weight>>::type
242+
xlin_w(std::size_t &idx, std::size_t &stride, double &x, First &&first,
243+
Rest &&... rest) const {
245244
detail::xlin(idx, stride, fusion::at_c<D>(axes_),
246245
std::forward<First>(first));
247246
return xlin_w<D + 1>(idx, stride, x, std::forward<Rest>(rest)...);
248247
}
249248

250249
template <unsigned D, typename First, typename... Rest>
251-
inline
252-
typename enable_if<is_same<First, weight>>::type
253-
xlin_w(std::size_t &idx, std::size_t &stride, double &x,
254-
First &&first, Rest &&... rest) const {
250+
inline typename enable_if<is_same<First, weight>>::type
251+
xlin_w(std::size_t &idx, std::size_t &stride, double &x, First &&first,
252+
Rest &&... rest) const {
255253
x = first.value;
256254
return xlin_w<D>(idx, stride, x, std::forward<Rest>(rest)...);
257255
}
@@ -260,20 +258,18 @@ class histogram<Static, Axes, Storage> {
260258
inline void xlin_n(std::size_t &, std::size_t &, unsigned &) const {}
261259

262260
template <unsigned D, typename First, typename... Rest>
263-
inline
264-
typename disable_if<is_same<First, count>>::type
265-
xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x,
266-
First &&first, Rest &&... rest) const {
261+
inline typename disable_if<is_same<First, count>>::type
262+
xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x, First &&first,
263+
Rest &&... rest) const {
267264
detail::xlin(idx, stride, fusion::at_c<D>(axes_),
268265
std::forward<First>(first));
269266
return xlin_n<D + 1>(idx, stride, x, std::forward<Rest>(rest)...);
270267
}
271268

272269
template <unsigned D, typename First, typename... Rest>
273-
inline
274-
typename enable_if<is_same<First, count>>::type
275-
xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x,
276-
First&& first, Rest &&... rest) const {
270+
inline typename enable_if<is_same<First, count>>::type
271+
xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x, First &&first,
272+
Rest &&... rest) const {
277273
x = first.value;
278274
return xlin_n<D>(idx, stride, x, std::forward<Rest>(rest)...);
279275
}

0 commit comments

Comments
 (0)