Rolling back use of typedef with smart pointers.

This is to reduce the obfuscation of the code.
This commit is contained in:
Ian Dinwoodie
2019-05-18 10:12:01 -04:00
parent 176fe54642
commit 5a4975691f
7 changed files with 37 additions and 48 deletions

View File

@@ -37,7 +37,6 @@ class Hunter
class WildDog
{
public:
typedef std::shared_ptr<WildDog> ptr_t;
void bark(void)
{
std::cout << "*wild dog bark*" << std::endl;
@@ -47,7 +46,7 @@ class WildDog
class WildDogAdapter : public Lion
{
public:
WildDogAdapter(WildDog::ptr_t dog)
WildDogAdapter(std::shared_ptr<WildDog> dog)
: dog_(dog)
{
}
@@ -58,12 +57,12 @@ class WildDogAdapter : public Lion
}
private:
WildDog::ptr_t dog_;
std::shared_ptr<WildDog> dog_;
};
int main()
{
WildDog::ptr_t wildDog = std::make_shared<WildDog>();
std::shared_ptr<WildDog> wildDog = std::make_shared<WildDog>();
WildDogAdapter wildDogAdapter(wildDog);
Hunter hunter;