You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This line gives the following error when compiled with c++11 option:
/opt/ros/indigo/include/ros/topic.h|64 col 12| error: no viable conversion from 'MConstPtr' (aka 'shared_ptr<const stdr_msgs::RobotIndexedVectorMsg_<std::allocator<void> > >') to 'bool'
return message_;
The reason is that in C++11, shared_ptr has an explicit operator bool which means that a shared_ptr can't be implicitly converted to a bool. A trivial fix could be applied to make the code compatible with both the new and the old stardards:
returnstatic_cast<bool>(message_);
Alternatively, one could write:
return message_.get() != 0;
Please let me know which version is preferable and I will submit a pull request.
The text was updated successfully, but these errors were encountered:
This line gives the following error when compiled with
c++11
option:The reason is that in C++11,
shared_ptr
has an explicitoperator bool
which means that ashared_ptr
can't be implicitly converted to abool
. A trivial fix could be applied to make the code compatible with both the new and the old stardards:Alternatively, one could write:
Please let me know which version is preferable and I will submit a pull request.
The text was updated successfully, but these errors were encountered: