Debian Codegraph @

gcc/testsuite/g++.dg/inherit/operator2.C

raw
1 typedef int INT_TYPEDEF;
2
3 template<class T>
4 class TypedIfc
5 {
6 public:
7 virtual ~TypedIfc() { }
8 virtual operator const T&() const = 0;
9 virtual const T& operator= (const T& t) = 0;
10 };
11
12 template<class Tnative>
13 class NullIfc : public TypedIfc<Tnative>
14 {
15 public:
16 const Tnative& operator= (const Tnative& t) { return t; }
17 operator const Tnative&() const { return *(Tnative *)0; }
18 };
19
20 typedef TypedIfc<INT_TYPEDEF> INT_TYPEDEFIfc;
21
22 NullIfc<int> i32;