auto in lambda is introduced in #1773 .
in #1773, auto in lambda is considered to enabled in c++11, but actually it is from c++14
this build error occurs in jsk_pcl_ros because jsk_pcl_ros forces to use -std=c++14 or -std=c++11, -std=c++0x.
some robot with gcc, which only supports c++11 not c++14, (i.e. pr1012, fetch15) fails to build jsk_pcl_ros because of this issue.
/home/applications/ros/indigo/src/jsk-ros-pkg/jsk_common/jsk_topic_tools/include/jsk_topic_tools/connection_based_nodelet.h: In member function ?ros::Publisher jsk_topic_tools::ConnectionBasedNodelet::adv
ertise(ros::NodeHandle&, std::string, int, bool)?:
/home/applications/ros/indigo/src/jsk-ros-pkg/jsk_common/jsk_topic_tools/include/jsk_topic_tools/connection_based_nodelet.h:198:24: error: parameter declared ?auto?
= [this](auto& pub){ connectionCallback(pub); };
^
/home/applications/ros/indigo/src/jsk-ros-pkg/jsk_common/jsk_topic_tools/include/jsk_topic_tools/connection_based_nodelet.h: In lambda function:
/home/applications/ros/indigo/src/jsk-ros-pkg/jsk_common/jsk_topic_tools/include/jsk_topic_tools/connection_based_nodelet.h:198:49: error: ?pub? was not declared in this scope
= [this](auto& pub){ connectionCallback(pub); };
^
auto in lambda is introduced in #1773 . in #1773,
auto
in lambda is considered to enabled inc++11
, but actually it is fromc++14
this build error occurs injsk_pcl_ros
becausejsk_pcl_ros
forces to use-std=c++14
or-std=c++11
,-std=c++0x
. some robot with gcc, which only supportsc++11
notc++14
, (i.e. pr1012, fetch15) fails to buildjsk_pcl_ros
because of this issue.https://cpprefjp.github.io/lang/cpp14/generic_lambdas.html https://stackoverflow.com/questions/7709894/using-auto-in-a-lambda-function