Skip to content

Commit

Permalink
since 1.60.0, boost uses placeholders namesapce for _1,_2..., on prec…
Browse files Browse the repository at this point in the history
…ise(12.03) / boost 1.48, we need to defined _1 under boost::placeholders namespace
  • Loading branch information
k-okada committed Feb 8, 2022
1 parent 8c3b0b0 commit e725fae
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
20 changes: 20 additions & 0 deletions include/opencv_apps/nodelet.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@
#include <nodelet/nodelet.h>
#include <boost/thread.hpp>
#include <image_transport/image_transport.h>
#if BOOST_VERSION < 106000 // since 1.60.0, boost uses placeholders namesapce for _1,_2...
#ifndef BOOST_PLAEHOLDERS
#define BOOST_PLAEHOLDERS
namespace boost
{
namespace placeholders
{
extern boost::arg<1> _1;
extern boost::arg<2> _2;
extern boost::arg<3> _3;
extern boost::arg<4> _4;
extern boost::arg<5> _5;
extern boost::arg<6> _6;
extern boost::arg<7> _7;
extern boost::arg<8> _8;
extern boost::arg<9> _9;
} // namespace placeholders
} // namespace boost
#endif // BOOST_PLAEHOLDERS
#endif // BOOST_VERSION < 106000

// https://stackoverflow.com/questions/10496824/how-to-define-nullptr-for-supporting-both-c03-and-c11
#if !defined(nullptr)
Expand Down
20 changes: 20 additions & 0 deletions src/nodelet/nodelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,26 @@
*********************************************************************/

#include "opencv_apps/nodelet.h"
#if BOOST_VERSION < 106000 // since 1.60.0, boost uses placeholders namesapce for _1,_2...
#ifndef BOOST_PLAEHOLDERS
#define BOOST_PLAEHOLDERS
namespace boost
{
namespace placeholders
{
boost::arg<1> _1;
boost::arg<2> _2;
boost::arg<3> _3;
boost::arg<4> _4;
boost::arg<5> _5;
boost::arg<6> _6;
boost::arg<7> _7;
boost::arg<8> _8;
boost::arg<9> _9;
} // namespace placeholders
} // namespace boost
#endif // BOOST_PLAEHOLDERS
#endif // BOOST_VERSION < 106000

namespace opencv_apps
{
Expand Down

0 comments on commit e725fae

Please sign in to comment.