Skip to content

Instantly share code, notes, and snippets.

@sithhell
sithhell / bind_protect_demo_functor.cpp
Created March 28, 2012 09:00
Complete Bind solution with protect and a functor
#include <boost/assign/std/vector.hpp>
#include <boost/bind.hpp>
#include <boost/bind/protect.hpp>
#include <boost/function.hpp>
#include <iostream>
#include <vector>
#include <algorithm>
template <typename F>
@sithhell
sithhell / bind_protect_demo.cpp
Created March 28, 2012 08:59
Complete Bind solution with protect
#include <boost/assign/std/vector.hpp>
#include <boost/bind.hpp>
#include <boost/bind/protect.hpp>
#include <boost/function.hpp>
#include <iostream>
#include <vector>
#include <algorithm>
void g(boost::function<void(int)> const &f, int i) {
@sithhell
sithhell / fusion_avoid_full_specialization.patch
Created September 12, 2011 13:30
A patch to show the impact of full template specialisations of boost.fusion (patch is against rev. 74355)
Index: boost/fusion/container/vector/detail/equal_to_impl.hpp
===================================================================
--- boost/fusion/container/vector/detail/equal_to_impl.hpp (revision 74355)
+++ boost/fusion/container/vector/detail/equal_to_impl.hpp (working copy)
@@ -17,11 +17,8 @@
namespace extension
{
- template <typename Tag>
- struct equal_to_impl;
@sithhell
sithhell / 99bob.cpp
Created August 22, 2011 19:22 — forked from randomphrase/99bob.cpp
99 Bottles Of Beer, using Boost MPL
#include <boost/mpl/assert.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/back_inserter.hpp>
#include <boost/mpl/copy.hpp>
#include <boost/mpl/divides.hpp>
#include <boost/mpl/empty_sequence.hpp>
#include <boost/mpl/equal.hpp>
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/fold.hpp>
#include <boost/mpl/for_each.hpp>
#include <iostream>
#include <boost/proto/proto.hpp>
#include <boost/fusion/include/pair.hpp>
#include <boost/fusion/include/as_map.hpp>
#include <boost/fusion/include/as_vector.hpp>
#include <boost/fusion/include/push_back.hpp>
using namespace std;
using namespace boost::proto;