From 40bf56c5fffd581908407412c5b945522433cf82 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 8 Dec 2015 09:34:34 +0000 Subject: [PATCH] vim: function alias snippet for cpp --- vim/ultisnips/cpp.snippets | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vim/ultisnips/cpp.snippets b/vim/ultisnips/cpp.snippets index 3539ca2..93d6618 100644 --- a/vim/ultisnips/cpp.snippets +++ b/vim/ultisnips/cpp.snippets @@ -81,3 +81,13 @@ private: }; endsnippet + +# http://stackoverflow.com/a/9864472 +snippet alias "Function alias" b +template +auto ${1:alias}(Args&&... args) + -> decltype($2(std::forward(args)...)) +{ + return ${2:function}(std::forward(args)...); +} +endsnippet -- 2.48.1