Improve c+ snippets (class, for-in, and misc)
This commit is contained in:
parent
4a294edbac
commit
072f7a47ca
@ -14,6 +14,17 @@ abbr template <T>
|
||||
template<typename ${1:T}>
|
||||
|
||||
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<iostream> int main...
|
||||
#include <iostream>
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user