Skip to content

Instantly share code, notes, and snippets.

@milan11
milan11 / git-rebase-2.sh
Created July 28, 2015 15:25
Git - rebasing a tree
#!/bin/bash
set -e
set -u
function init_repo
{
git init testrepo
cd testrepo
}
@milan11
milan11 / get_set_test.cpp
Created April 18, 2013 22:30
get_set.hpp test
#include <iostream>
#include <vector>
#include <boost/integer.hpp>
#include <boost/assign/std/vector.hpp>
#include "get_set.hpp"
class Package {
public:
@milan11
milan11 / get_set.hpp
Created April 18, 2013 22:27
macros for defining getters, setters and constructor arguments
#pragma once
#include <boost/config.hpp>
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#define CONSTRUCTOR_PARAM(type, name) \
const type & name
#define TO_FIELD(name) \
@milan11
milan11 / shared_ref.hpp
Last active November 27, 2016 17:23
not nullable boost shared_ptr
#pragma once
#include <boost/shared_ptr.hpp>
#define make_shared_ptr(T, ...) (boost::make_shared<T>(__VA_ARGS__))
#define make_shared_ref(T, ...) ((boost::shared_ref<T>)boost::make_shared<T>(__VA_ARGS__))
namespace boost {
template<class T>