编译错误之类型错误
错误:invalid initialization of reference of type 'const Quote&' from expression of type 'const key_type {aka const std::shared_ptr}'
解释:用const std::shared_ptr来初始化const Quote&是无效的。aka表示also known as。
解决方式:参数问题:把const Quote& 改成const std::shared_ptr,在自己的代码中。
或者反过来修改,在源代码中。
或者加const 或者去掉&,总之就是把两个类型改成同一个。
类似错误:
error: binding 'const std::__cxx11::basic_string
解释:把const string与string&绑定在一起丢弃了限定符。discards qualifiers表示丢弃限定符
解决方式:参照示例
#include#include <string> #include