rtl:生锈的模板库 源码
生锈的模板库 有一天,我不得不写C ++。 但是我拒绝了! 选项 // none rtl::Option opt; // implicit cast to false for "None" values assert (!opt); // assign some value opt = rtl::some( " hello " ); // implicit cast to true for "Some" values assert (opt); // unwrap takes ownership, leaving "None" assert (opt.unwrap() == "hello"); assert (opt.unwrap_or( " world " ) == " world"); // alternative syntax to assign a val
用户评论