Improve c+ snippets (class, for-in, and misc)

This commit is contained in:
ujihisa 2013-12-29 19:55:17 -08:00
parent 4a294edbac
commit 072f7a47ca

View File

@ -14,6 +14,17 @@ abbr template <T>
template<typename ${1:T}> template<typename ${1:T}>
snippet class snippet class
abbr class {}
class ${1:#:name} {
${2}
public:
$1(${3});
};
$1::$1($3) {
${0:TARGET}
}
snippet class-without-constructor
abbr class {} abbr class {}
class ${1:#:name} { class ${1:#:name} {
${2} ${2}
@ -34,6 +45,12 @@ abbr for (:) {}
${0:TARGET} ${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 ) # lambda expression ( C++11 feature )
snippet lambda snippet lambda
abbr [](){} abbr [](){}
@ -76,10 +93,13 @@ abbr dynamic_cast<>()
snippet helloworld snippet helloworld
abbr #include<iostream> int main... abbr #include<iostream> int main...
#include <iostream> #include <iostream>
int main(int argc, char const* argv[]) int main(int argc, char const* argv[])
{ {
using namespace std; std::cout << "hello, world!" << std::endl;
cout << "hello, world!" << endl;
return 0; return 0;
} }
snippet p
options head
std::cout << ${0:TARGET} << std::endl;