rtti: re-indent

master
neingeist 10 years ago
parent c3a436f695
commit 5de6b902c9

@ -4,45 +4,45 @@
class Nail {
public:
Nail(float length)
: length(length) {};
public:
Nail(float length)
: length(length) {}
float getLength() {
return length;
}
float getLength() {
return length;
}
private:
float length;
private:
float length;
};
class Tool {
public:
virtual void use() {
std::cout << "Just using some tool." << std::endl;
}
public:
virtual void use() {
std::cout << "Just using some tool." << std::endl;
}
};
class Hammer : public Tool {
public:
virtual void use() {
std::cout << "Hammer time!" << std::endl;
}
void use(Nail nail) {
std::cout << "The nail is " << nail.getLength() << " cm long"
<< std::endl;
}
public:
virtual void use() {
std::cout << "Hammer time!" << std::endl;
}
void use(Nail nail) {
std::cout << "The nail is " << nail.getLength() << " cm long"
<< std::endl;
}
};
class SledgeHammer : public Hammer {
public:
void use(Nail nail __attribute__((unused))) {
throw std::runtime_error("Can't use a sledge hammer on nails!");
}
public:
void use(Nail nail __attribute__((unused))) {
throw std::runtime_error("Can't use a sledge hammer on nails!");
}
};

Loading…
Cancel
Save