Created
January 14, 2020 09:07
-
-
Save utilForever/2ae80e1bf7b37ee1be40bfd73c35b39b to your computer and use it in GitHub Desktop.
Simple unique_ptr Test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A | |
{ | |
public: | |
static std::unique_ptr<IEffect> AttackN(int n) | |
{ | |
return B::Attack(n); | |
} | |
static std::unique_ptr<IEffect> HealthN(int n) | |
{ | |
return B::Health(n); | |
} | |
static std::unique_ptr<IEffect[]> AttackHealthN(int n) | |
{ | |
std::unique_ptr<IEffect[]> a(new IEffect[2]{ *AttackN(n), *HealthN(n) }); | |
return std::move(a); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment