Skip to content

Instantly share code, notes, and snippets.

View redpist's full-sized avatar

Jeremy Lecerf redpist

View GitHub Profile
@redpist
redpist / 1.hh
Created September 16, 2012 11:07
Example C++ML 1
#ifndef _1_H_
#define _1_H_
#include <iostream>
template <class TChild>
class GrandParent
{
protected:
@redpist
redpist / 2.hh
Created September 16, 2012 13:07
Example C++ML 2
#ifndef _2_H_
#define _2_H_
#include <iostream>
struct Abidbul { };
template <int i>
struct NumType { };
@redpist
redpist / 3.hh
Created September 16, 2012 18:22
Example C++ML 3
#ifndef _3_H_
#define _3_H_
#include <vector>
typedef std::vector<int> Matrix1;
typedef std::vector<std::vector<int> > Matrix2;
typedef std::vector<std::vector<std::vector<int> > > Matrix3;
template <typename T>
@redpist
redpist / 1.hh
Created September 17, 2012 22:48
C++ML example 1
#ifndef _1_H_
#define _1_H_
#include <iostream>
template <class TChild>
class GrandParent
{
protected:
GrandParent() { }
@redpist
redpist / 2.hh
Created September 17, 2012 22:49
C++ML example 2
#ifndef _2_H_
#define _2_H_
#include <iostream>
struct Abidbul { };
template <int i>
struct NumType { };
@redpist
redpist / 3.hh
Created September 17, 2012 22:50
C++ML example 3
#ifndef MAKEEACHMPLTOSHAREDPTR_HPP_
# define MAKEEACHMPLTOSHAREDPTR_HPP_
# include <boost/mpl/vector.hpp>
# include <boost/mpl/back.hpp>
# include <boost/mpl/push_front.hpp>
# include <boost/mpl/pop_back.hpp>
# include <boost/mpl/empty.hpp>
# include <memory>
typedef int Integer;
class Wolf
{
public:
class Head
{
};
};
#include <list>
class Wolf
{
public:
typedef std::list<Wolf> Pack;
};
template <typename T>
struct Commonplace
{
typedef T Type;
};