Skip to content

Instantly share code, notes, and snippets.

@utilForever
Created January 14, 2020 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save utilForever/2ae80e1bf7b37ee1be40bfd73c35b39b to your computer and use it in GitHub Desktop.
Save utilForever/2ae80e1bf7b37ee1be40bfd73c35b39b to your computer and use it in GitHub Desktop.
Simple unique_ptr Test
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