inline-functions.cpp [plain text]
struct A {
inline void f();
};
void A::f() { }
template<typename> struct B { };
template<> struct B<char> {
inline void f();
};
void B<char>::f() { }
void f() { }
inline void f1(int);
void f1(int) { }
void test_f1() { f1(17); }
namespace test1 {
template <typename T> class ClassTemplate {
private:
friend void T::func();
void g() {}
};
class C {
public:
void func() {
ClassTemplate<C> ct;
ct.g();
}
};
void f() {
C c;
c.func();
}
}
namespace test2 {
struct A;
void f(const A& a);
struct A {
friend void f(const A& a) { }
};
void g() {
A a;
f(a);
}
}