[Cbc] std::bind2nd in CoinPackedMatrix.cpp/CoinPackedVector.cpp vs. C++17

Dr.-Ing. Christoph Cullmann cullmann at absint.com
Sun Aug 27 12:06:07 EDT 2017


Hi,

current clang & libc++ 5.0.0 (rc3, but final will do the same) fail to compile the CoinPackedMatrix.cpp & CoinPackedVector.cpp, for example

CoinPackedMatrix.cpp:1497:8: error: no member named 'bind2nd' in namespace 'std'
                std::bind2nd(std::plus<int>(), minorDim_));

if the C++17 standard is used, which removes that function.

A fix would be to use 

std::bind(std::plus<int>(), placeholders::_1, minorDim_)

(same for all other uses of std::bind2nd in CoinPackedVector.cpp & CoinPackedMatrix.cpp)

or lambdas.

Two Osi files have the same issue:

Osi/test/OsiTestSolverInterface.cpp:               std::bind2nd(std::multiplies<double>(), objsense_));
Osi/src/OsiCommonTest/OsiSolverInterfaceTest.cpp:          std::bind2nd(std::plus<double>(),0.15)) ;

Greetings
Christoph

-- 
----------------------------- Dr.-Ing. Christoph Cullmann ---------
AbsInt Angewandte Informatik GmbH      Email: cullmann at AbsInt.com
Science Park 1                         Tel:   +49-681-38360-22
66123 Saarbrücken                      Fax:   +49-681-38360-20
GERMANY                                WWW:   http://www.AbsInt.com
--------------------------------------------------------------------
Geschäftsführung: Dr.-Ing. Christian Ferdinand
Eingetragen im Handelsregister des Amtsgerichts Saarbrücken, HRB 11234



More information about the Cbc mailing list