The word “elision” means “omission”, like how the two-syllable “do not” becomes the one-syllable “don’t”, or Captain Kirk never seems to brush his teeth. It’s not necessary to show everything.
The following examples use my class Loud, which displays a message for every method invoked.
#include "Loud.h" int main() { Loud alpha; }
Loud::Loud() Loud::~Loud()
No surprise, here. alpha
got created & destroyed.
#include "Loud.h" int main() { Loud beta, gamma; }
Loud::Loud() Loud::Loud() Loud::~Loud() Loud::~Loud()
Sure.
#include "Loud.h" int main() { Loud delta; Loud epsilon(delta); delta=epsilon; }
Loud::Loud() Loud::Loud(const Loud &) Loud::operator=(const Loud &) Loud::~Loud() Loud::~Loud()
As expected.
#include "Loud.h" Loud foo() { Loud zeta; return zeta; } int main() { Loud eta(foo()); }
Loud::Loud() Loud::~Loud()
zeta
and eta
, should have been created.
#include "Loud.h" int main() { Loud theta = Loud(Loud(Loud(Loud(Loud(Loud(Loud(Loud()))))))); }
Loud::Loud() Loud::~Loud()
There should be more than that.
#include "Loud.h" Loud foo() { Loud iota; return iota; } int main() { Loud kappa(foo()); }
Loud::Loud() Loud::~Loud()
Loud
class.
iota
.
Instead, the ctor in foo()
constructs directly in kappa
.
No copying; it’s built in the right place.
int
get passed as an argument?
double *
?
std::string
?
std::string *
?
std::string &
?
const std::string &
?
int
?
std::string
?