diff --git a/neosnippets/cpp.snip b/neosnippets/cpp.snip index 4c42cef..639c067 100644 --- a/neosnippets/cpp.snip +++ b/neosnippets/cpp.snip @@ -14,6 +14,17 @@ abbr template template snippet class +abbr class {} + class ${1:#:name} { + ${2} + public: + $1(${3}); + }; + $1::$1($3) { + ${0:TARGET} + } + +snippet class-without-constructor abbr class {} class ${1:#:name} { ${2} @@ -34,6 +45,12 @@ abbr for (:) {} ${0:TARGET} } +# range based for ( C++11 feature ) +snippet for_CPP11_const_auto + for (const auto &${1:#:var} : ${2:#:container}) { + ${0:TARGET} + } + # lambda expression ( C++11 feature ) snippet lambda abbr [](){} @@ -76,10 +93,13 @@ abbr dynamic_cast<>() snippet helloworld abbr #include int main... #include + int main(int argc, char const* argv[]) { - using namespace std; - cout << "hello, world!" << endl; + std::cout << "hello, world!" << std::endl; return 0; } +snippet p +options head + std::cout << ${0:TARGET} << std::endl;