]> git.rmz.io Git - dotfiles.git/commitdiff
vim: rule of 5 snippet
authorSamir Benmendil <samir.benmendil@ultrahaptics.com>
Fri, 26 Oct 2018 16:10:30 +0000 (17:10 +0100)
committerSamir Benmendil <samir.benmendil@ultrahaptics.com>
Fri, 26 Oct 2018 16:10:30 +0000 (17:10 +0100)
vim/ultisnips/cpp.snippets

index d5083d53cfe5702da0b4209b0609b5bfad12f632..4c79d78bb90e1d9e9ff905fdfcf046f789725baa 100644 (file)
@@ -24,6 +24,15 @@ private:
 }; // class${1/.+/ $0/m}
 endsnippet
 
+snippet rule5 "Default constructors/destructors/operaters" b
+${1:classname}() = default;
+~$1() = default;
+$1(const $1 &) = default;
+$1($1 &&) = default;
+$1 &operator=(const $1 &) = default;
+$1 &operator=($1 &&) = default;
+endsnippet
+
 snippet ns "namespace .. (namespace)"
 namespace${1/.+/ /m}${1:`!p snip.rv = snip.basename or "name"`} {
 ${VISUAL}${0}