On 2 Jul 2015 at 9:36, Joseph Van Riper wrote:
(Sorry so many snips, but I wanted to focus on something specific).
It probably isn't elegant, but maybe we could explore something like:
tribool t;
boost::if_( t, [&]( /*true condition's code*/), [&](/*false conditions code*/), [&](/* indeterminate conditions code*/) );
Although there has to be a better way to clean it up... maybe with tagging the arguments or something.
Lightweight monad already has that: monadstd::string a("niall"); // Does bind work with chains of value, error, exception and empty? auto x( a >> [ec](std::string){return ec;} >> [](std::error_code){return std::make_exception_ptr(5);} >> [](std::exception_ptr){return;} >> [](monadstd::string::empty_type){return std::string("douglas");} ); BOOST_CHECK(x.get()=="douglas"); // Does monad type permutation from bind work? auto y( a >> [ec](std::string) -> monad<int> {return ec;} >> [](std::error_code){return std::make_exception_ptr(5);} >> [](std::exception_ptr){return;} >> [](monad<int>::empty_type){return 5;} ); BOOST_CHECK(y.get()==5); Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/