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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [lto/] [20091004-2_1.C] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
typedef double Real;
2
class Vector {
3
    int dimen;
4
    Real* val;
5
public:
6
    Vector& operator=(const Vector& vec);
7
    Vector(int p_dimen, Real *p_val)
8
        : dimen(p_dimen), val(p_val)    { }
9
    int dim() const;
10
};
11
class DVector : public Vector {
12
public:
13
    void reDim(int newdim);
14
    explicit DVector(const Vector& old);
15
    DVector& operator=(const Vector& vec)    {
16
        reDim(vec.dim());
17
        Vector::operator=(vec);
18
    }
19
};
20
Vector& Vector::operator=(const Vector& vec)
21
{
22
  dimen = vec.dimen;
23
  val = vec.val;
24
}
25
int Vector::dim() const { return dimen; }
26
DVector::DVector(const Vector& old) : Vector(0, 0)
27
{
28
  *this = old;
29
}
30
void DVector::reDim(int newdim) {}
31
int main() {}
32
 

powered by: WebSVN 2.1.0

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