sample.cxx revision afbca4cfdb6c7468d7c07c56dc1dc5173456903b
// compile me with g++
/* this is sample comment } */
#include <string>
#include <vector>
#include <iostream>
#define TEST(x) (x)
class SomeClass {
public:
SomeClass() /* I'm constructor */
: attr_(0)
{
}
~SomeClass() // destructor
{
}
int MemberFunc(int a, int b) const {
// some member function
return a + b;
}
int operator++(int) {
return attr_++;
}
template<typename T>
return v.size();
}
private:
int attr_;
};
namespace ns1 {
class NamespacedClass {
public:
}
};
namespace ns2 {
int foo(int a, int b) {
SomeClass t;
}
}
}
int bar(int x /* } */)
{
// another function
int d;
int f;
f = foo(x, d);
/* return
some
rubish
*/
return d+f;
}
// main function
SomeClass c;
int res;
return 0; }