boostorg / ublas

Boost.uBlas
https://www.boost.org/doc/libs/release/libs/numeric/ublas
107 stars 153 forks source link

C++20: ‘class std::allocator’ has no member named ‘construct’ #95

Closed mclow closed 4 years ago

mclow commented 4 years ago

Taken from the -developers mailing list.

Problem description: When compiling the following example:

#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>

int main () {
using namespace boost::numeric::ublas;
matrix m (3, 3);
for (unsigned i = 0; i < m.size1 (); ++ i)
  for (unsigned j = 0; j < m.size2 (); ++ j)
    m (i, j) = 3 * i + j;
std::cout << m << std::endl;
}

with gcc-10 with -std=gnu++2a flag, compilation breaks Running the same compilation line with -std=gnu++17 passes

boost build command lines: ./bootstrap.sh --prefix="${PWD}/../boost-bin" ./b2 ./b2 install

Compiled on ubuntu 18.04, added gcc-10: sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt install gcc-10 g++-10

Compilation error: testboost.cpp:9:27: required from here /home/ubuntu/repos/cv-engine/externals/boost-bin/include/boost/numeric/ublas/storage.hpp:79:30: error: ‘class std::allocator’ has no member named ‘construct’ 79 | alloc.construct(d, value_type());

mclow commented 4 years ago

Duplicate. Sorry for the noise.

jmarrec commented 2 years ago

The duplicate is https://github.com/boostorg/ublas/issues/96