lgottwald / PaPILO

Parallel Presolve for Integer and Linear Optimization
GNU Lesser General Public License v3.0
38 stars 2 forks source link

implicit instantiation of undefined template 'boost::serialization::nvp<bool>' #31

Closed AntoinePrv closed 4 years ago

AntoinePrv commented 4 years ago

Description

I've occasionally run into this error: https://github.com/boostorg/serialization/issues/186

../include/boost/multiprecision/cpp_bin_float.hpp:533:12: error: implicit instantiation of undefined template 'boost::serialization::nvp<bool>'
      ar & boost::serialization::make_nvp("sign", m_sign);
           ^
.../include/boost/multiprecision/detail/number_base.hpp:60:14: note: template is declared here
      struct nvp;

In the following cases:

These however worked fine:

Proposed solution

As suggested in the Boost issue, it got solved it by adding #include <boost/serialization/nvp.hpp> here https://github.com/lgottwald/PaPILO/blob/894525d3402c2050909786680ddc4e2cbf1385bb/src/papilo/misc/MultiPrecision.hpp#L56 and there https://github.com/lgottwald/PaPILO/blob/894525d3402c2050909786680ddc4e2cbf1385bb/src/papilo/misc/MultiPrecision.hpp#L124

Is this a change that would make sense in PaPILO?

lgottwald commented 4 years ago

Yes that seems to make sense. The include will never hurt and catch the cases where a user has a boost version that has this problem.