Skip to content

Instantly share code, notes, and snippets.

View benben's full-sized avatar
🤔
Are we still online?

Benjamin Knofe benben

🤔
Are we still online?
View GitHub Profile
@benben
benben / factory.cpp
Created June 30, 2011 13:46 — forked from pyrtsa/factory.cpp
Object factory using Boost.Phoenix, Boost.Function and Boost.SmartPtr libraries
#include <boost/foreach.hpp>
#include <boost/function.hpp>
#include <boost/spirit/include/phoenix.hpp>
#include <boost/variant.hpp>
#include <iostream>
#include <map>
#include <string>
#include <vector>
struct Object1 { std::string hello() const { return "Hi, Object1"; } };
@benben
benben / factory.cpp
Created June 28, 2011 16:53 — forked from pyrtsa/factory.cpp
Object factory using Boost.Phoenix, Boost.Function and Boost.SmartPtr libraries
#include <boost/foreach.hpp>
#include <boost/function.hpp>
#include <boost/spirit/include/phoenix.hpp>
#include <boost/shared_ptr.hpp>
#include <iostream>
#include <map>
#include <string>
#include <vector>
struct Parent { virtual std::string hello() const = 0; };