Re: [eigen] binder1st and binder2nd

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hello all,

Boost.config provides a 'BOOST_HAS_TR1_BIND' macro that tells whether std::tr1::bind
is available. It could be used to support both c++98 and c++17.

More generally, Eigen has entire modules depending on c++11 (ie. the Tensor module),
which could be enabled depending of Boost.config macros maybe. Using the
'__cplusplus' macro only is apparently not reliable because of compilers having only
partial support of a given c++ version.

Best,
Godeffroy

2015-06-15 7:52 GMT+02:00 Mathieu Dutour <mathieu.dutour@xxxxxxxxx>:
Dear all,

in its latest version, Eigen is still using std::binder1st and std::binder2nd.

As indicated in http://en.cppreference.com/w/cpp/utility/functional/binder12
those functions are deprecated since C++11 and will disappear in C++17.

Rationale for doing so is given in binders.h of gcc 5.1.0:
   *  These functions are deprecated in C++11 and can be replaced by
   *  @c std::bind (or @c std::tr1::bind) which is more powerful and flexible,
   *  supporting functions with any number of arguments.  Uses of @c bind1st
   *  can be replaced by @c std::bind(f, x, std::placeholders::_1) and
   *  @c bind2nd by @c std::bind(f, std::placeholders::_1, x).

Sincerely,

  Mathieu



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/