#include #include //#include struct A { A(void) { } }; struct B { B(void) { } }; struct C { C(const A &) { } C(const B &) { } C(const C &) { } }; namespace boost { namespace lambda { //namespace detail { template<> struct return_type_2, A&, B&> { typedef C type; }; template<> struct return_type_2, const A&, const B&> { typedef C type; }; template<> struct return_type_2, const A, const B> { typedef C type; }; template<> struct return_type_2, A, B> { typedef C type; }; //} } } int main(int argc, char**argv) { using namespace boost::lambda; const bool b = argc > 1; const A sa; const B sb; const BOOST_AUTO(sc, if_then_else_return(var(b), var(sa), var(sb))()); return 0; }