X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/6e8502d9db631f046997419b28a9af75841f2d04..a9258672b4d7b9e877d197d394e7291196c18ce5:/vim/ultisnips/cpp.snippets?ds=inline diff --git a/vim/ultisnips/cpp.snippets b/vim/ultisnips/cpp.snippets index 99cfa78..d5083d5 100644 --- a/vim/ultisnips/cpp.snippets +++ b/vim/ultisnips/cpp.snippets @@ -56,7 +56,7 @@ snippet cplat "Cross platform pre processor split" b ${1} #elif defined(__APPLE__) ${2} -#elif defined(WIN32) +#elif defined(_WIN32) ${3} #endif endsnippet @@ -122,6 +122,15 @@ auto ${1:alias}(Args&&... args) } endsnippet +# https://stackoverflow.com/a/14803335 +snippet bind_memfun +template +std::function ${1:object_bind}(Ret (T::* fun)(Args...), T &t) +{ + return [=](Args... args) { return (t.*fun)(args...); }; +} +endsnippet + snippet once "#pragma once" b #pragma once