Skip to content

Instantly share code, notes, and snippets.

View lilianmoraru's full-sized avatar

Lilian Anatolie Moraru lilianmoraru

View GitHub Profile
containers:
ubuntu:
setup:
- !Ubuntu trusty
- !UbuntuUniverse
- !Env
HOME: /root
- !Install [git, ca-certificates, curl, gcc, g++, cmake,
build-essential, autoconf2.13, libcap-dev,
@lilianmoraru
lilianmoraru / main.cpp
Last active August 29, 2015 14:05
C++11 Example
//For demonstration purposes we move reverse into a separate function
// In C++98 - this would make a deep copy then throw the original
// In C++11 - It will detect that a temporary is passed. It uses move semantics automatically.
// Copies the pointer and takes ownership of the buffer.
// Doesn't do a shallow copy or deep copy.
// There is no need to implicitly tell the compiler what to do with a temporary data,
// it's error prone while the compiler knows
// better and the case is very simple for the compiler to detect.
// If the user wants, he can tell it explicitly with "string&& s"
string reverse_string(string s) {