C++0x Error: overloading a function with std::shared_ptr to const argument is ambiguous

后端 未结 4 593
醉梦人生
醉梦人生 2021-01-18 09:04

Suppose I have two unrelated classes A and B. I also have a class Bla that uses boost::shared_ptr like t

4条回答
  •  轮回少年
    2021-01-18 09:28

    You can use std::static_pointer_cast to add the const qualification:

    bla.foo(std::static_pointer_cast(a));
    

提交回复
热议问题