Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mclow opened this issue Aug 3, 2020 · 2 comments
Closed

Comments

@mclow
Copy link
Contributor

mclow commented Aug 3, 2020

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:
test_boost.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
Copy link
Contributor Author

mclow commented Aug 3, 2020

Duplicate. Sorry for the noise.

@mclow mclow closed this as completed Aug 3, 2020
@jmarrec
Copy link

jmarrec commented Oct 27, 2021

The duplicate is #96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants