repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git]
/
old-autovect-branch
/
gcc
/
testsuite
/
g++.dg
/
template
/
operator1.C
blob
402e607d1e4fd789b9eebe7033cc25733e0f16b7
1
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
}