error: ‘optional’ in namespace ‘std’ does not name a template type
编译出错,好几回遇到optional的出错了,这次记一下吧
std::optional是C++17中专有的,在C++14中,optional好像是experimental下面,具体使用需自己查阅资料。
error: ‘optional’ in namespace ‘std’ does not name a template type
std::optional<gtsam::Pose3> doICPVirtualRelative( int _loop_kf_idx, int _curr_kf_idx )
解决方法:
在cmakelist中设置为C++17编译即可。
set(CMAKE_CXX_STANDARD 17)