Skip to content

Commit

Permalink
Use std::enable_if rather than boost::enable_if
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Mar 15, 2023
1 parent 8144eda commit 8024417
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 5 additions & 7 deletions include/RMF/Vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#include "exceptions.h"
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/mpl/not.hpp>
#include <type_traits>
#include <array>
#include <boost/static_assert.hpp>
#include <algorithm>
Expand All @@ -39,15 +38,14 @@ class Vector
struct Convert {};

template <class R>
struct Convert<R, typename boost::enable_if<boost::is_convertible<
R, std::array<float, D> > >::type> {
struct Convert<R, typename std::enable_if<std::is_convertible<
R, std::array<float, D> >::value>::type> {
static void convert(const R& r, std::array<float, D>& d) { d = r; }
};

template <class R>
struct Convert<
R, typename boost::enable_if<boost::mpl::not_<
boost::is_convertible<R, std::array<float, D> > > >::type> {
struct Convert<R, typename std::enable_if<!std::is_convertible<
R, std::array<float, D> >::value>::type> {
static void convert(const R& r, std::array<float, D>& d) {
std::copy(boost::begin(r), boost::end(r), d.begin());
}
Expand Down
3 changes: 1 addition & 2 deletions swig/RMF_HDF5.i
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ RMF_VC_PRAGMA(warning( disable: 4503 ))
#include <boost/version.hpp>
#include <boost/exception/all.hpp>

#include <boost/type_traits/is_convertible.hpp>
#include <boost/utility/enable_if.hpp>
#include <type_traits>
#include <exception>

#include "RMF/internal/swig_helpers.h"
Expand Down

0 comments on commit 8024417

Please sign in to comment.