OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [operator1.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
class test
2
{
3
public:
4
 float operator[]( int index )
5
 {
6
  return testFloat[index];
7
 }
8
private:
9
 float testFloat[3];
10
};
11
 
12
template < class typeA > float
13
operator*(
14
 typeA a,
15
 float b
16
)
17
{
18
 return a[0] * b;
19
}
20
 
21
template < class typeB > float
22
operator*(
23
 float a,
24
 typeB b
25
)
26
{
27
 return a * b[0];
28
}
29
 
30
template < class typeA, class typeB > float
31
operator*(
32
 typeA a,
33
 typeB b
34
)
35
{
36
 return a[0] * b[0];
37
}
38
 
39
int main( void )
40
{
41
 test aTest;
42
 float bTest;
43
 float result;
44
 
45
 result = aTest * bTest;
46
 result = bTest * aTest;
47
 
48
 return 0;
49
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.