You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

14 lines
271 B

# -*- 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;
}