2

I have been using range based for loops for quite a time.I am doing it by changing the settings of my Dev C++ compiler from this way.However new features of c++ 17 won't support in this compiler.Like

for (auto&& [first,second] : mymap) {
    // use first and second
}

Is there any way to change the settings or download some extra files to support range based for loops in my compiler?

My setups:

WINDOWS 10

Version - Dev c++ 5.11

Compiler - TDM-GCC 4.6.1 64 bit.

Perdente
  • 75
  • 2
  • 11
  • 1
    `Version - Dev c++ 5.11` -- Not important. What is important is the actual compiler being used to compile the code. I am quite sure that `g++` version 4.x is too old to support these features. [See this](https://gcc.gnu.org/) and [this](https://gcc.gnu.org/projects/cxx-status.html) – PaulMcKenzie Aug 08 '20 at 16:45
  • GCC 4.x supports C++11. `for (auto&& [first,second] : mymap)` is structured binding and was introduced in C++14. Update your compiler: https://jmeubank.github.io/tdm-gcc/download/ – Thomas Sablik Aug 08 '20 at 16:49
  • 5
    You should consider switching to a different IDE. The newest release is 5.11 from April 27, 2015. Even though you could update the compiler and build your projects the syntax highlighting probably won't work with new features. – Thomas Sablik Aug 08 '20 at 16:56
  • 1
    Choose a different ide. Dev c++ is clearly out of date. We are on gcc 10 in the modern world. – Taekahn Aug 08 '20 at 20:12

1 Answers1

-2

You need to update your compiler to install gcc9.2 (c++ 17 compiler),you can follow this link