Re: [eigen] binder1st and binder2nd

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


Hi Christoph,

yes the binder2st and binder2nd are still present in the development version
of the source code. available by mercurial.

File is src/Core/functors/StlFunctors.h

Code sample:

template<typename T>
struct functor_traits<std::binder2nd<T> >
{ enum { Cost = functor_traits<T>::Cost, PacketAccess = false }; };

  Mathieu

On Mon, Jun 15, 2015 at 10:57 AM, Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi,

first of all, binder1st and binder2nd are entirely removed from the devel-branch (if not, please report where!). This means version 3.3 will be "binder-free". C++11 support for the 3.2 branch is not good anyways, so I don't think it's worth backporting these changes.
If you want to use Eigen with C++11, I'd recommend switching to the devel-branch (or ignore/disable the deprecated warnings).

We make checks slightly more sophisticated than checking __cplusplus already. If you find things that don't work as intended, please report them and we do our best to fix them. We intentionally don't want to depend on boost (nor anything other than the std-library).


Christoph



Am 15.06.2015 um 10:41 schrieb Godeffroy VALET:
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




--
----------------------------------------------
Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
Cartesium 0.049
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: +49 (421) 218-64252
----------------------------------------------





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