Skip to content

Commit

Permalink
gcc-4.8 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski committed Oct 30, 2017
1 parent 9d9b44e commit e0304ab
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
30 changes: 17 additions & 13 deletions include/boost/histogram/histogram_impl_dynamic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,34 +327,38 @@ class histogram<Dynamic, Axes, Storage> {
template <unsigned D>
inline void xlin_w(std::size_t &, std::size_t &, double &) const {}

template <unsigned D, typename... Rest>
inline void xlin_w(std::size_t &idx, std::size_t &stride, double &x,
weight &&w, Rest &&... rest) const {
x = w.value;
template <unsigned D, typename First, typename... Rest>
inline typename enable_if<is_same<First, weight>>::type
xlin_w(std::size_t &idx, std::size_t &stride, double &x, First &&first,
Rest &&... rest) const {
x = first.value;
return xlin_w<D>(idx, stride, x, std::forward<Rest>(rest)...);
}

template <unsigned D, typename First, typename... Rest>
inline void xlin_w(std::size_t &idx, std::size_t &stride, double &x,
First &&f, Rest &&... rest) const {
apply_visitor(xlin_visitor<First>{idx, stride, std::forward<First>(f)},
inline typename disable_if<is_same<First, weight>>::type
xlin_w(std::size_t &idx, std::size_t &stride, double &x, First &&first,
Rest &&... rest) const {
apply_visitor(xlin_visitor<First>{idx, stride, std::forward<First>(first)},
axes_[D]);
return xlin_w<D + 1>(idx, stride, x, std::forward<Rest>(rest)...);
}

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

template <unsigned D, typename... Rest>
inline void xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x,
count &&c, Rest &&... rest) const {
x = c.value;
template <unsigned D, typename First, typename... Rest>
inline typename enable_if<is_same<First, count>>::type
xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x, First &&first,
Rest &&... rest) const {
x = first.value;
return xlin_n<D>(idx, stride, x, std::forward<Rest>(rest)...);
}

template <unsigned D, typename First, typename... Rest>
inline void xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x,
First &&f, Rest &&... rest) const {
inline typename disable_if<is_same<First, count>>::type
xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x, First &&f,
Rest &&... rest) const {
apply_visitor(xlin_visitor<First>{idx, stride, std::forward<First>(f)},
axes_[D]);
return xlin_n<D + 1>(idx, stride, x, std::forward<Rest>(rest)...);
Expand Down
28 changes: 12 additions & 16 deletions include/boost/histogram/histogram_impl_static.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,20 +238,18 @@ class histogram<Static, Axes, Storage> {
inline void xlin_w(std::size_t &, std::size_t &, double &) const {}

template <unsigned D, typename First, typename... Rest>
inline
typename disable_if<is_same<First, weight>>::type
xlin_w(std::size_t &idx, std::size_t &stride, double &x,
First &&first, Rest &&... rest) const {
inline typename disable_if<is_same<First, weight>>::type
xlin_w(std::size_t &idx, std::size_t &stride, double &x, First &&first,
Rest &&... rest) const {
detail::xlin(idx, stride, fusion::at_c<D>(axes_),
std::forward<First>(first));
return xlin_w<D + 1>(idx, stride, x, std::forward<Rest>(rest)...);
}

template <unsigned D, typename First, typename... Rest>
inline
typename enable_if<is_same<First, weight>>::type
xlin_w(std::size_t &idx, std::size_t &stride, double &x,
First &&first, Rest &&... rest) const {
inline typename enable_if<is_same<First, weight>>::type
xlin_w(std::size_t &idx, std::size_t &stride, double &x, First &&first,
Rest &&... rest) const {
x = first.value;
return xlin_w<D>(idx, stride, x, std::forward<Rest>(rest)...);
}
Expand All @@ -260,20 +258,18 @@ class histogram<Static, Axes, Storage> {
inline void xlin_n(std::size_t &, std::size_t &, unsigned &) const {}

template <unsigned D, typename First, typename... Rest>
inline
typename disable_if<is_same<First, count>>::type
xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x,
First &&first, Rest &&... rest) const {
inline typename disable_if<is_same<First, count>>::type
xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x, First &&first,
Rest &&... rest) const {
detail::xlin(idx, stride, fusion::at_c<D>(axes_),
std::forward<First>(first));
return xlin_n<D + 1>(idx, stride, x, std::forward<Rest>(rest)...);
}

template <unsigned D, typename First, typename... Rest>
inline
typename enable_if<is_same<First, count>>::type
xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x,
First&& first, Rest &&... rest) const {
inline typename enable_if<is_same<First, count>>::type
xlin_n(std::size_t &idx, std::size_t &stride, unsigned &x, First &&first,
Rest &&... rest) const {
x = first.value;
return xlin_n<D>(idx, stride, x, std::forward<Rest>(rest)...);
}
Expand Down

0 comments on commit e0304ab

Please # to comment.