-2

is that possible that g++ somehow compile my program with older standard than I specified?

I compile with:

g++ -Wall -Wextra -pedantic -O3 -std=c++2a -fconcepts

And compiler can't recognize bind_front function ( I included <functional> ). Compiler version is GCC 8.3.

NutCracker
  • 11,485
  • 4
  • 44
  • 68
ziyiyituxe
  • 177
  • 1
  • 9

1 Answers1

2

GCC 8.3 does not support std::bind_front. Check here.

You need to use GCC 9.1 or 9.2. Check here.

How to install GCC 9?

UPDATE

As the @walnut's comment says, there is a g++ 9 package in the standard repositories since Ubuntu 19.04.

NutCracker
  • 11,485
  • 4
  • 44
  • 68
  • The answers in the linked question seem slightly out-of-date. There seems to be a g++-9 package in the standard repositories since Ubuntu 19.04: https://packages.ubuntu.com/en/disco/g++-9 – walnut Feb 03 '20 at 08:41
  • I've got ubuntu 19.04, i have apt updated and isntalled g++. When i type ```g++ --version``` its still 8.3, how is that posible? / I want to compile with g++ comand as default g++9 ) – ziyiyituxe Feb 03 '20 at 11:04
  • 1
    @ziyiyituxe Have you followed the instructions from the link I provided? – NutCracker Feb 03 '20 at 11:11
  • yes I used this commands ```sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt install gcc-9``` and I can compile with g++-9 but i need g++ to be -9 by default – ziyiyituxe Feb 03 '20 at 11:19
  • 1
    @ziyiyituxe try this `sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9` – NutCracker Feb 03 '20 at 11:22