llvm.org GIT mirror llvm / a5f1991
[docs] [cleanup] No need for a comment around C++11 override git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227304 91177308-0d34-0410-b5e6-96231b3b80d8 Sean Silva 4 years ago
1 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
3939 double SideLength;
4040 public:
4141 Square(double S) : SideLength(S) {}
42 double computeArea() /* override */;
42 double computeArea() override;
4343 };
4444
4545 class Circle : public Shape {
4646 double Radius;
4747 public:
4848 Circle(double R) : Radius(R) {}
49 double computeArea() /* override */;
49 double computeArea() override;
5050 };
5151
5252 The most basic working setup for LLVM-style RTTI requires the following
134134 public:
135135 - Square(double S) : SideLength(S) {}
136136 + Square(double S) : Shape(SK_Square), SideLength(S) {}
137 double computeArea() /* override */;
137 double computeArea() override;
138138 };
139139
140140 class Circle : public Shape {
142142 public:
143143 - Circle(double R) : Radius(R) {}
144144 + Circle(double R) : Shape(SK_Circle), Radius(R) {}
145 double computeArea() /* override */;
145 double computeArea() override;
146146 };
147147
148148 #. Finally, you need to inform LLVM's RTTI templates how to dynamically
174174 double SideLength;
175175 public:
176176 Square(double S) : Shape(SK_Square), SideLength(S) {}
177 double computeArea() /* override */;
177 double computeArea() override;
178178 +
179179 + static bool classof(const Shape *S) {
180180 + return S->getKind() == SK_Square;
185185 double Radius;
186186 public:
187187 Circle(double R) : Shape(SK_Circle), Radius(R) {}
188 double computeArea() /* override */;
188 double computeArea() override;
189189 +
190190 + static bool classof(const Shape *S) {
191191 + return S->getKind() == SK_Circle;