cpp class Test { private: inline static int value_ = 0; // 允许在多个文件中定义 }; 4. std::optional C++17的std::optional提供了一种优雅的方式来处理可选值,避免使用哨兵值或指针。 cpp struct Result { char c; uint32_t pos; }; std::optional ...