#pragma once #include "common_defines.hpp" #ifdef new #undef new #endif #include #include using boost::tuple; using boost::make_tuple; //using boost::get; // "get" is very common name, use "get" member function /* #include using std::tr1::tuple; using std::tr1::make_tuple; using std::tr1::get; */ template struct tuple_length { static const int value = boost::tuples::length::value; }; template struct tuple_element { typedef typename boost::tuples::element::type type; }; namespace impl { template struct for_each_tuple_impl { template void operator() (Tuple & t, ToDo & toDo) { toDo(boost::tuples::get(t), N); for_each_tuple_impl c; c(t, toDo); } }; template <> struct for_each_tuple_impl<-1> { template void operator() (Tuple &, ToDo &) {} }; } template void for_each_tuple(Tuple & t, ToDo & toDo) { impl::for_each_tuple_impl::value-1> c; c(t, toDo); } #ifdef DEBUG_NEW #define new DEBUG_NEW #endif