Skip to content

Instantly share code, notes, and snippets.

View pperehozhih's full-sized avatar

Pavel Perehozhih pperehozhih

View GitHub Profile
#include <iostream>
#include <stack>
#include <cassert>
struct BaseValue {
virtual ~BaseValue() {}
};
template<typename T>
struct Value : public BaseValue{
//
// khash.h
//
// Created by Paul Perekhozhikh on 16.10.13.
// Copyright (c) 2013 Paul. All rights reserved.
//
#ifndef khash_h
#define khash_h
#include <iostream>
#include <stack>
#include <cassert>
template <std::size_t... I>
class index_sequence {};
template <std::size_t N, std::size_t ...I>
struct make_index_sequence : make_index_sequence<N-1, N-1,I...> {};
@pperehozhih
pperehozhih / simple.cpp
Created February 26, 2016 11:00
replace static_cast to dynamic_cast
#include <iostream>
#include <vector>
#include <cstdlib>
struct test {
};
struct test_virt : public test {
virtual void foo(){}
};
@pperehozhih
pperehozhih / gist:934b3dd1ae2633461292
Created February 26, 2016 08:38
overload static_cast
#include <iostream>
#include <vector>
#include <cstdlib>
struct test {
};
struct test_virt : public test {
virtual void foo(){}
};