都不 C ++ 14中Either的功能实现。 buckaroo add github.com/loopperfect/neither 例子 处理不安全代码 auto unsafe = [] { // a function that throws, sometimes we can't avoid it... if ( true ) { throw std::runtime_error ( " error " ); } return 1 ; } Either e = Try(unsafe); // let's lift the exception in