summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.bob/template2.C
blob: 7da9deb2901c9c6ff1f9fdc2725d40b691636686 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// { dg-do assemble  }
// prms-id: 10046
template <class T>
class Array
{
public:
    T const & operator[] (int i) const;
};

class Referenceable {};

template < class Referencee >
class Referencer
{
public:
    operator Referencee *() const { return i_referencee; }

protected:
    Referencee* i_referencee;
};

class ScenarioGroup {};

class ScenarioSpace;

class ScenarioSet : public Referenceable,
		    public Array< Referencer<ScenarioGroup> >
{
public:
    ScenarioSet& operator=(ScenarioSet const & s);
};

class ScenarioSpace : public Referenceable,
		      public Array< Referencer<ScenarioSet> >
{
};

class ScenarioSetNameSelector
{
public:
    bool operator () (ScenarioSpace &space)
    {
	int idx;
	i_set = space[idx];
	return false;
    }
private:
    ScenarioSet *i_set;
};