6 %warnfilter(SWIGWARN_LANG_IDENTIFIER);
12 void globalscope(); // forward declaration needed for some compilers
21 friend void ::globalscope();
22 friend int mix(A* a, B *b);
32 void globalscope() { B b(0); b.v=10; }
40 friend int get_val1(const A& a)
45 /* simple overloading */
46 friend int get_val1(const A& a, int o)
52 note that operators << and >> are ignored, as they
53 should, since no rename is performed.
55 friend std::istream& operator>>(std::istream& in, A& a);
57 /* already declare at B */
58 friend int mix(A* a, B *b);
61 friend int get_val2(const A& a)
67 friend int get_val3(const A& a);
69 /* this should be ignored */
70 friend std::ostream& operator<<(std::ostream& out, const A& a)
80 'mix' is an interesting case, this is the third declaration
81 swig is getting (two friends + one inline).
83 inline int mix(A* a, B *b) {
87 /* this should be ignored */
88 inline std::istream& operator>>(std::istream& in, A& a) {
95 inline int get_val3(const A& a) {
99 /* another overloading */
100 inline int get_val1(int i, int a, int b) {
106 sit and watch how well this case works, is just incredible!!,
108 also note that there is no special code added to manage friends
109 and templates (or overloading), this is just old swig magic
118 /* note that here we are overloading the already super
119 overloaded 'get_val1' */
120 friend C get_val1(D& b)
125 /* here set will be 'auto' overloaded, depending of the
126 %template instantiations. */
127 friend void set(D& b, C v)
144 // Use this version with extra qualifiers to test SWIG as some compilers accept this
151 friend void ns1::baz();
152 void Foo::member() { }
159 // Remove extra qualifiers for the compiler as some compilers won't compile the extra qaulification (eg gcc-4.1 onwards)
167 friend void ns1::baz();
177 %template(D_i) D<int>;
178 %template(D_d) D<double>;