dotfiles/.emacs.d/snippets/c++-mode/operator=

14 lines
271 B
Plaintext
Raw Normal View History

2017-12-21 17:29:29 +01:00
# -*- 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;
}