都不:和也许也许单子在C ++中更好的错误处理 源码
都不 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
下载地址
用户评论