(Emacs)+snippets from doom-snippet and removed default package
I've re-enabled yasnippet for ease of use, and added a ton of snippets directly into my Dotfiles so only I get to curate what snippets are removed. Screw downloading them off someone else's repository at their total mercy.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
cc-mode text-mode prog-mode
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: accumulate
|
||||
# key: acm
|
||||
# --
|
||||
auto sum = std::accumulate(std::begin(${1:container}), std::end($1), 0);
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: accumulate w/ closure
|
||||
# key: acl
|
||||
# --
|
||||
auto sum = std::accumulate(std::begin(${1:container}), std::end($1), 0, [](int total, $2) {
|
||||
$3
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: adjacent_find
|
||||
# key: ajf
|
||||
# --
|
||||
auto pos = std::adjacent_find(std::begin(${1:container}), std::end($1));
|
||||
if (pos != std::end($1)) {
|
||||
$2
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: all_of
|
||||
# key: alo
|
||||
# --
|
||||
if (std::all_of(std::begin(${1:container}), std::end($1), []($2) {
|
||||
$3
|
||||
})) {
|
||||
$4
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: any_of
|
||||
# key: ano
|
||||
# --
|
||||
if (std::any_of(std::begin(${1:container}), std::end($1), []($2) {
|
||||
$3
|
||||
})) {
|
||||
$4
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: assert
|
||||
# --
|
||||
assert($0);
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: v.begin(), v.end()
|
||||
# key: beginend
|
||||
# uuid: beginend
|
||||
# --
|
||||
${1:v}.begin(), $1.end
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: boost_require
|
||||
# key: req
|
||||
# uuid: req
|
||||
# group: boost
|
||||
# --
|
||||
BOOST_REQUIRE( ${1:condition} );
|
||||
$0
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: class
|
||||
# --
|
||||
class ${1:Name} {
|
||||
public:
|
||||
${1:$(yas/substr yas-text "[^: ]*")}();
|
||||
${2:virtual ~${1:$(yas/substr yas-text "[^: ]*")}();}
|
||||
$0
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: const_[]
|
||||
# key: c[
|
||||
# uuid: c[
|
||||
# --
|
||||
const ${1:Type}& operator[](${2:int index}) const
|
||||
{
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: constructor
|
||||
# key: ct
|
||||
# uuid: ct
|
||||
# --
|
||||
${1:Class}::$1(${2:args}) ${3: : ${4:init}} {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: copy
|
||||
# key: cpy
|
||||
# --
|
||||
std::copy(std::begin(${1:container}), std::end($1), std::begin($2));
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: copy_backward
|
||||
# key: cpb
|
||||
# --
|
||||
std::copy_backward(std::begin(${1:container}), std::end($1), std::end($1));
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: copy_if
|
||||
# key: cpi
|
||||
# --
|
||||
std::copy_if(std::begin(${1:container}), std::end($1), std::begin($2),
|
||||
[]($3) {
|
||||
$4
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: copy_n
|
||||
# key: cpn
|
||||
# --
|
||||
std::copy_n(std::begin(${1:container}), $2, std::end($1));
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: copy
|
||||
# key: oit
|
||||
# --
|
||||
std::copy(std::begin(${1:container}), std::end($1), std::ostream_iterator<$2>{
|
||||
%\istd::cout, "$3"
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: count
|
||||
# key: cnt
|
||||
# --
|
||||
auto n = std::count(std::begin(${1:container}), std::end($1), $2);
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: count_if
|
||||
# key: count_if
|
||||
# --
|
||||
auto n = std::count_if(std::begin(${1:container}), std::end($1), []($2) {
|
||||
$3
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: cstd
|
||||
# key: cstd
|
||||
# uuid: cstd
|
||||
# --
|
||||
#include <cstdlib>
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: d+=
|
||||
# key: d+=
|
||||
# uuid: d+=
|
||||
# --
|
||||
${1:MyClass}& operator+=(${2:const $1 &});
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: d_operator<<
|
||||
# key: <<
|
||||
# uuid: <<
|
||||
# --
|
||||
friend std::ostream& operator<<(std::ostream&, const ${1:Class}&);
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: d_operator[]
|
||||
# key: [
|
||||
# uuid: [
|
||||
# --
|
||||
${1:Type}& operator[](${2:int index});
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: d_operator[]_const
|
||||
# key: c[
|
||||
# uuid: c[
|
||||
# --
|
||||
const ${1:Type}& operator[](${2:int index}) const;
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: d_operator>>
|
||||
# key: >>
|
||||
# --
|
||||
friend std::istream& operator>>(std::istream&, const ${1:Name}&);
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: d_operator<<
|
||||
# key: <<
|
||||
# --
|
||||
friend std::ostream& operator<<(std::ostream&, const ${1:Name}&);
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: delete
|
||||
# key: dl
|
||||
# uuid: dl
|
||||
# --
|
||||
delete ${1:pointer};
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: delete[]
|
||||
# key: dla
|
||||
# uuid: dla
|
||||
# --
|
||||
delete[] ${1:arr};
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: doc
|
||||
# key: /**
|
||||
# uuid: /**
|
||||
# --
|
||||
/**
|
||||
* $0
|
||||
*/
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: dynamic_casting
|
||||
# key: cast
|
||||
# uuid: cast
|
||||
# --
|
||||
check_and_cast<${1:Type} *>(${2:msg});
|
||||
@@ -0,0 +1,4 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: enum
|
||||
# --
|
||||
enum ${1:NAME} {$0};
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: equal
|
||||
# key: eql
|
||||
# --
|
||||
if (std::equal(std::begin(${1:container}), std::end($1), std::begin($2))) {
|
||||
$3
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: remove
|
||||
# key: erm
|
||||
# --
|
||||
${1:container}.erase(std::remove(std::begin($1), std::end($1), $2), std::end($1));
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: generate_n
|
||||
# key: erf
|
||||
# --
|
||||
${1:container}.erase($1.find_last_not_of(" \t\n\r") + 1);
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: fill
|
||||
# key: fil
|
||||
# --
|
||||
std::fill(std::begin(${1:container}), std::end($1), $2);
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: fill_n
|
||||
# key: fln
|
||||
# --
|
||||
std::fill_n(std::begin(${1:container}), $2, $3);
|
||||
11
Emacs/.config/emacs/.config/yasnippet/snippets/c++-mode/fin
Normal file
11
Emacs/.config/emacs/.config/yasnippet/snippets/c++-mode/fin
Normal file
@@ -0,0 +1,11 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: find_if_not
|
||||
# key: fin
|
||||
# --
|
||||
auto pos = std::find_if_not(std::begin(${1:container}), std::end($1),[]($2) {
|
||||
$3
|
||||
});
|
||||
if (pos != std::end($1)) {
|
||||
$4
|
||||
}
|
||||
$0
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: find
|
||||
# key: fnd
|
||||
# --
|
||||
auto pos = std::find(std::begin(${1:container}), std::end($1), $2);
|
||||
if (pos != std::end($1)) {
|
||||
$3
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: find_end
|
||||
# key: fne
|
||||
# --
|
||||
auto pos = std::find_std::end(
|
||||
std::begin(${1:container}), std::end($1),
|
||||
std::begin($2), std::end($3)
|
||||
);
|
||||
if (pos != std::end($1)) {
|
||||
$4
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: find_first_of
|
||||
# key: ffo
|
||||
# --
|
||||
auto pos = std::find_first_of(
|
||||
std::begin(${1:container}), std::end($1),
|
||||
std::begin($2), std::end($3)
|
||||
);
|
||||
if (pos != std::end($1)) {
|
||||
$4
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: find_if
|
||||
# key: fni
|
||||
# --
|
||||
auto pos = std::find_if(std::begin(${1:container}), std::end($1), []($2) {
|
||||
$3
|
||||
});
|
||||
if (pos != std::end($1)) {
|
||||
$4
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: fixture
|
||||
# key: fixt
|
||||
# uuid: fixt
|
||||
# --
|
||||
BOOST_FIXTURE_TEST_SUITE( ${1:name}, ${2:Fixture} )
|
||||
|
||||
$0
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for_each
|
||||
# key: fre
|
||||
# --
|
||||
std::for_each(std::begin(${1:container}), std::end($1), []($2) {
|
||||
$3
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for_iter
|
||||
# key: fori
|
||||
# uuid: fori
|
||||
# --
|
||||
for (${1:iter}=${2:var}.begin(); $1!=$2.end(); ++$1) {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: friend
|
||||
# key: fr
|
||||
# uuid: fr
|
||||
# --
|
||||
friend $0;
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: fun_declaration
|
||||
# key: f
|
||||
# uuid: f
|
||||
# --
|
||||
${1:void} ${2:name}($3)$0
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: function
|
||||
# --
|
||||
${1:void} ${2:Class}::${3:name}($4)${5: const} {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: generate
|
||||
# key: gnr
|
||||
# --
|
||||
std::generate(std::begin(${1:container}), std::end($1), []($2) {
|
||||
$3
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: generate_n
|
||||
# key: gnn
|
||||
# --
|
||||
std::generate_n(std::begin(${1:container}), $2, []($3) {
|
||||
$4
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: gtest
|
||||
# key: gtest
|
||||
# uuid: gtest
|
||||
# group: testing
|
||||
# --
|
||||
#include <gtest/gtest.h>
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: ignore
|
||||
# key: ignore
|
||||
# uuid: ignore
|
||||
# --
|
||||
${1:std::}cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: #include <lib>
|
||||
# key: inc
|
||||
# --
|
||||
#include <${1:lib}>
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: #include <iostream>
|
||||
# key: iio
|
||||
# uuid: iio
|
||||
# --
|
||||
#include <iostream>
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: #include <sstream>
|
||||
# key: iss
|
||||
# uuid: iss
|
||||
# --
|
||||
#include <sstream>
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: #include <string>
|
||||
# key: istr
|
||||
# uuid: istr
|
||||
# --
|
||||
#include <string>
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: inline
|
||||
# key: il
|
||||
# uuid: il
|
||||
# --
|
||||
inline $0
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: iota
|
||||
# key: ita
|
||||
# --
|
||||
std::iota(std::begin(${1:container}), std::end($1), $2);
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: is_heap
|
||||
# key: ihp
|
||||
# --
|
||||
if (std::is_heap(std::begin(${1:container}), std::end($1))) {
|
||||
$2
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: is_heap_until
|
||||
# key: ihu
|
||||
# --
|
||||
auto pos = std::is_heap_until(std::begin(${1:container}), std::end($1));
|
||||
if (pos != std::end($1)) {
|
||||
$2
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: is_partitioned
|
||||
# key: ipt
|
||||
# --
|
||||
if (std::is_partitioned(std::begin(${1:container}), std::end($1), []($2) {
|
||||
$3
|
||||
})) {
|
||||
$4
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: is_permutation
|
||||
# key: ipr
|
||||
# --
|
||||
if (std::is_permutation(std::begin(${1:container}), std::end($1), std::begin($2))) {
|
||||
$3
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: is_sorted
|
||||
# key: iss
|
||||
# --
|
||||
if (std::is_sorted(std::begin(${1:container}), std::end($1))) {
|
||||
$2
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: is_sorted_until
|
||||
# key: isu
|
||||
# --
|
||||
auto pos = std::is_sorted_until(std::begin(${1:container}), std::end($1));
|
||||
if (pos != std::end($1)) {
|
||||
$2
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: iterator
|
||||
# key: iter
|
||||
# uuid: iter
|
||||
# --
|
||||
${1:std::}${2:vector<int>}::iterator ${3:iter};
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: lambda
|
||||
# key: lam
|
||||
# --
|
||||
[$1]($2) { `(!%!)`$3 }
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: lexigraphical_compare
|
||||
# key: lxc
|
||||
# --
|
||||
if (std::lexigraphical_compare(std::begin(${1:container}), std::end($1), std::begin($2), std::end($3))) {
|
||||
$4
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: make_heap
|
||||
# key: mkh
|
||||
# --
|
||||
std::make_heap(std::begin(${1:container}), std::end($1));
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: map
|
||||
# key: map
|
||||
# uuid: map
|
||||
# --
|
||||
std::map<${1:type1}$0> ${2:var};
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: max_element
|
||||
# key: mxe
|
||||
# --
|
||||
auto pos = std::max_element(std::begin(${1:container}), std::end($1));
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: member_function
|
||||
# key: mf
|
||||
# --
|
||||
${1:type} ${2:Name}::${3:name}(${4:args})${5: const}
|
||||
{
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: merge
|
||||
# key: mrg
|
||||
# --
|
||||
std::merge(std::begin(${1:container}), std::end($1),
|
||||
std::begin($2), std::end($3), std::begin($4));
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: min_element
|
||||
# key: mne
|
||||
# --
|
||||
auto pos = std::min_element(std::begin(${1:container}), std::end($1));
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: minmax_element
|
||||
# key: mme
|
||||
# --
|
||||
auto minmax = std::minmax_element(std::begin(${1:container}), std::end($1));
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: mismatch
|
||||
# key: msm
|
||||
# --
|
||||
auto values = std::mismatch(std::begin(${1:container}), std::end($1), std::begin($1));
|
||||
if (values.first == std::end($1)) {
|
||||
$2
|
||||
} else {
|
||||
$3
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: module
|
||||
# key: mod
|
||||
# uuid: mod
|
||||
# --
|
||||
class ${1:Class} : public cSimpleModule
|
||||
{
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: move_backward
|
||||
# key: mpb
|
||||
# --
|
||||
std::move_backward(std::begin(${1:container}), std::end($1), std::end($1));
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name : namespace ...
|
||||
# key: ns
|
||||
# uuid: ns
|
||||
# --
|
||||
namespace ${1:name}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: namespace
|
||||
# key: nss
|
||||
# --
|
||||
namespace ${1:name} {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: next_permutation
|
||||
# key: nxp
|
||||
# --
|
||||
if (std::next_permutation(std::begin(${1:container}), std::end($1))) {
|
||||
$2
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: none_of
|
||||
# key: nno
|
||||
# --
|
||||
if (std::none_of(std::begin(${1:container}), std::end($1), []($2) {
|
||||
$3
|
||||
})) {
|
||||
$4
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: nth_element
|
||||
# key: nth
|
||||
# --
|
||||
std::nth_element(std::begin(${1:container}), std::end($1), std::end($1));
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator!=
|
||||
# key: !=
|
||||
# uuid: !=
|
||||
# group: operator overloading
|
||||
# --
|
||||
bool ${1:MyClass}::operator!=(const $1 &other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator+
|
||||
# key: +
|
||||
# uuid: +
|
||||
# group: operator overloading
|
||||
# --
|
||||
${1:MyClass} $1::operator+(const $1 &other)
|
||||
{
|
||||
$1 result = *this;
|
||||
result += other;
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator+=
|
||||
# key: +=
|
||||
# uuid: +=
|
||||
# group: operator overloading
|
||||
# --
|
||||
${1:MyClass}& $1::operator+=(${2:const $1 &rhs})
|
||||
{
|
||||
$0
|
||||
return *this;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator=
|
||||
# key: =
|
||||
# uuid: =
|
||||
# where this is a reference to myself
|
||||
# group: operator overloading
|
||||
# --
|
||||
${1:MyClass}& $1::operator=(const $1 &rhs) {
|
||||
// Check for self-assignment!
|
||||
if (this == &rhs)
|
||||
return *this;
|
||||
$0
|
||||
return *this;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator==
|
||||
# key: ==
|
||||
# uuid: ==
|
||||
# group: operator overloading
|
||||
# --
|
||||
bool ${1:MyClass}::operator==(const $1 &other) const {
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator[]
|
||||
# key: []
|
||||
# uuid: []
|
||||
# group: operator overloading
|
||||
# --
|
||||
${1:Type}& operator[](${2:int index})
|
||||
{
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator>>
|
||||
# key: >>
|
||||
# uuid: >>
|
||||
# group: operator overloading
|
||||
# --
|
||||
istream& operator>>(istream& s, const ${1:type}& ${2:c})
|
||||
{
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: operator<<
|
||||
# key: <<
|
||||
# uuid: <<
|
||||
# group: operator overloading
|
||||
# --
|
||||
std::ostream& operator<<(std::ostream& s, const ${1:type}& ${2:c})
|
||||
{
|
||||
$0
|
||||
return s;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: ostream
|
||||
# key: os
|
||||
# uuid: os
|
||||
# --
|
||||
#include <ostream>
|
||||
10
Emacs/.config/emacs/.config/yasnippet/snippets/c++-mode/pack
Normal file
10
Emacs/.config/emacs/.config/yasnippet/snippets/c++-mode/pack
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: pack
|
||||
# key: pack
|
||||
# uuid: pack
|
||||
# --
|
||||
void cNetCommBuffer::pack(${1:type}) {
|
||||
|
||||
}
|
||||
|
||||
$0
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: partial_sort
|
||||
# key: pst
|
||||
# --
|
||||
std::partial_sort(std::begin(${1:container}), std::end($1), std::end($1));
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: partial_sort_copy
|
||||
# key: psc
|
||||
# --
|
||||
std::partial_sort_copy(std::begin(${1:container}), std::end($1),
|
||||
std::begin($2), std::end($3));
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: partition
|
||||
# key: ptn
|
||||
# --
|
||||
auto pos = std::partition(std::begin(${1:container}), std::end($1), []($2) {
|
||||
$3
|
||||
});
|
||||
if (pos != std::end($1)) {
|
||||
$4
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: partition_copy
|
||||
# key: ptc
|
||||
# --
|
||||
std::partition_copy(std::begin(${1:container}), std::end($1),
|
||||
std::begin($2), std::end($3));
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: partition_point
|
||||
# key: ppt
|
||||
# --
|
||||
auto pos = std::partition_point(std::begin(${1:container}), std::end($1), []($2) {
|
||||
$3
|
||||
});
|
||||
if (pos != std::end($1)) {
|
||||
$4
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: prev_permutation
|
||||
# key: prp
|
||||
# --
|
||||
if (std::prev_permutation(std::begin(${1:container}), std::end($1))) {
|
||||
$2
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: private
|
||||
# expand-env: ((yas-also-auto-indent-first-line t))
|
||||
# --
|
||||
private:
|
||||
$0
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: protected
|
||||
# expand-env: ((yas-also-auto-indent-first-line t))
|
||||
# --
|
||||
protected:
|
||||
$0
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: public
|
||||
# expand-env: ((yas-also-auto-indent-first-line t))
|
||||
# --
|
||||
public:
|
||||
$0
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user