1

I have this piece of code :

#include <iostream>
#include <type_traits>

using namespace std;
int main(){
    cout << std::is_same<int,int>::value;  // this line is underlined (as a error)
    return 0;
}

I am not quite used to code C++ in Eclipse. So I have a Eclipse luna-SR2-32 (latest version), and I use tdm-gcc-4.9.2 as a compiler.

So the issue is that Eclipse underlines that line (look at the code) (is_same and value couldn't be resolved), however he has no problem including type_traits, I can even open it from eclipse Editor, and see that 'is_same' is the file.

When I compile and run it, it works fine but it stills underlined which is bothering me... It doesn't do this with some other c++11 features as tuple ...

I know this needs probably a simple configuration in Eclipse, but I tried many things already ... I added -std=c++11 in the compiler options (but nothing changed).

EDIT :

I tried the 3 first answers of this, but none of them worked ... But I tried using instead and now it is not underlined anymore ... Why is that ? I know that some librairies are in tr1 because they were added later, but why does he recognize and can run it, but still underlines my lines when I use it ?

Community
  • 1
  • 1
Othman Benchekroun
  • 1,998
  • 2
  • 17
  • 36

0 Answers0