class MyInt { private: int *p_num; public: MyInt(); MyInt(int n); int GetNum(); void SetNum(int n); MyInt& operator=(const MyInt &rtSide); };
#ifndef __MyInt_ class MyInt { private: int *p_num; public: MyInt(); MyInt(int n); int GetNum(); void SetNum(int n); MyInt& operator=(const MyInt &rtSide); }; #endif
#ifndef __MyInt_ #define __MyInt_ class MyInt { private: int *p_num; public: MyInt(); MyInt(int n); int GetNum(); void SetNum(int n); MyInt& operator=(const MyInt &rtSide); }; #endif
if (#define(MyInt)) { class MyInt { private: int *p_num; public: MyInt(); MyInt(int n); int GetNum(); void SetNum(int n); MyInt& operator=(const MyInt &rtSide); }; }
#define __MyInt_ class MyInt { private: int *p_num; public: MyInt(); MyInt(int n); int GetNum(); void SetNum(int n); MyInt& operator=(const MyInt &rtSide); }; #endif
using namespace std; namespace Foo { void zot(int i) { cout << i << endl; } } namespace Bar { void zot(int i) { cout << ++i << endl; } } int main() { int x=0; { using namespace Bar; zot(x); } { using namespace Foo; zot(x); } return 0; }
using std::cout; using std::cin;
using namespace std;
using namespace std; namespace Foo { void zot(int i) { cout << i << endl; } } namespace Bar { void zot(int i) { cout << ++i << endl; } } int main() { int x=0; using namespace Bar; using namespace Foo; zot(x); return 0; }
i.e. there is no:
using std::cout;
namespace std { cout << var; }