Why does the keyword auto not work for boost::shared pointer?
Hi,
I am running into a situation where boost::shared_ptr<costmap_2d::InflationLayer> inflation_layer_ptr = some_func();
works, but auto inflation_layer_ptr = some_func()
does not. some_func()
is a function that returns a boost::shared_ptr<costmap_2d::InflationLayer>
object.
I am using C++11 and ROS Kinetic. My understanding is in C++11, the keyword auto should work with std::shared_pointer. But what about boost::shared_ptr?
Please add what error you are seeing and the signature of
some_func()
at least; it should work.The error I see is
error: ‘inflation_layer’ does not name a type.
A minimal example is