std::optional语法上和指针类似
但是std::optional是值语义,指针是引用语义
c++目前不能对引用包装std::optional,所以需要考虑值语义的复制开销或者使用reference_wrapper
enum的underlying type
默认实现定义,但也可以自己指定
as of C++17, if an unscoped enumeration has an explicitly specified base, then the compiler will allow you to list initialize an unscoped enumeration using an integral value
unscoped enumeration会污染命名空间,不同enumeration可能会被隐式转换成underlying type来进行比较,这语义上不太合理,也没有简单办法避免
scoped enumeration不会被隐式转换成underlying type