my-emacs-d/elpa/yasnippet-20160924.2001/snippets/c++-mode/operator=
2016-10-20 10:27:10 +02:00

14 lines
271 B
Plaintext

# -*- mode: snippet -*-
# name: operator=
# key: =
# where this is a reference to myself
# group: operator overloading
# --
${1:MyClass}& $1::operator=(const $1 &rhs)
{
// Check for self-assignment!
if (this == &rhs)
return *this;
$0
return *this;
}