From e350f0f3e08d9bc89e9318c68bbff37eb1b3f3f4 Mon Sep 17 00:00:00 2001 From: salad Date: Wed, 10 Feb 2021 16:50:08 +0100 Subject: add snippets --- snippets/fundamental-mode/cppcpp | 28 ++++++++++++++++++++++++++++ snippets/fundamental-mode/cppheader | 16 ++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 snippets/fundamental-mode/cppcpp create mode 100644 snippets/fundamental-mode/cppheader diff --git a/snippets/fundamental-mode/cppcpp b/snippets/fundamental-mode/cppcpp new file mode 100644 index 0000000..eaa9ef9 --- /dev/null +++ b/snippets/fundamental-mode/cppcpp @@ -0,0 +1,28 @@ +# -*- mode: snippet -*- +# name: cppcpp +# key: cppcpp +# -- + +Name::Name(void) { + return ; +} + +Name::Name(std::string name) : _name(value) { + std::cout << "Name just appeared" << std::endl; + return ; +} + +Name::Name(Name const &src) { + *this = src; + return ; +} + +Name::~Name(void) { + std::cout << "Name was destroyed" << std::endl; + return ; +} + +Name & Name::operator=(Name const &rhs) { + this->field = rhs.getter(); + return (*this); +} diff --git a/snippets/fundamental-mode/cppheader b/snippets/fundamental-mode/cppheader new file mode 100644 index 0000000..b9eac41 --- /dev/null +++ b/snippets/fundamental-mode/cppheader @@ -0,0 +1,16 @@ +# -*- mode: snippet -*- +# name: cppheader +# key: cppheader +# -- + +\#include + +class Name { + public : + Name(); + Name(std::string name); + Name(Name const & name); + ~Name(); + + Name & operator=(Name const & rhs); +}; -- cgit v1.2.3