
Originally Posted by
spud
#ifdef Q_CC_MSVC
#include<hash_map>
using namespace stdext;
#endif
#ifdef Q_CC_GNU
#include<ext/hash_map>
using namespace __gnu_cxx;
#endif
#ifdef Q_CC_MSVC
#include<hash_map>
using namespace stdext;
#endif
#ifdef Q_CC_GNU
#include<ext/hash_map>
using namespace __gnu_cxx;
#endif
To copy to clipboard, switch view to plain text mode
That certainly didn't work. Is that some QT preprocessor that does the same thing? I opened up the glut.h file and saw how they have done it so I got upto here.
#include<iostream>
#include<cstdio>
#if defined(__MINGW32__)
#include<ext/hash_map>
using namespace __gnu_cxx;
#endif
#if defined(_MSC_VER)
#include<hash_map>
using namespace stdext;
#endif
#include<iostream>
#include<cstdio>
using namespace std;
int main(int argc,char** argv)
{
hash_map<int,int> mapping;
hash_map<int,int>::const_iterator miter;
mapping.insert(pair<int,int>(1,100));
mapping.insert(pair<int,int>(2,200));
miter = mapping.find(1);
if(miter == mapping.end())
cout << "Not found";
else
cout << miter->first << " = " << miter->second;
getchar();
return 0;
}
#include<iostream>
#include<cstdio>
#if defined(__MINGW32__)
#include<ext/hash_map>
using namespace __gnu_cxx;
#endif
#if defined(_MSC_VER)
#include<hash_map>
using namespace stdext;
#endif
#include<iostream>
#include<cstdio>
using namespace std;
int main(int argc,char** argv)
{
hash_map<int,int> mapping;
hash_map<int,int>::const_iterator miter;
mapping.insert(pair<int,int>(1,100));
mapping.insert(pair<int,int>(2,200));
miter = mapping.find(1);
if(miter == mapping.end())
cout << "Not found";
else
cout << miter->first << " = " << miter->second;
getchar();
return 0;
}
To copy to clipboard, switch view to plain text mode
The preprocessors have always confused me a bit. Is there a list of all the preprocessors that can be used (at least the more common ones ). Can anyone point to some good resource about types of general preprocessors or may be list some common ones out here ?
Bookmarks