Project

General

Profile

Actions

Bug #2109

closed

Conflict between std::placeholders and Boost placeholders

Added by Junxiao Shi about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Utils
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
1.00 h

Description

Snippet to reproduce:

#include <ndn-cxx/common.hpp>
#include <ndn-cxx/security/validator-config.hpp>

using namespace ndn;

void
f(int i)
{
}

int
main()
{
  bind(&f, _1);
  return 0;
}

Expected: the program compiles

Actual: error: reference to ‘_1’ is ambiguous


boost/bind/placeholders.hpp puts _1 in unnamed namespace and imports it to the global namespace.

However, this placeholder is incompatible with std::bind.

Applications are forced to write using std::placeholders::_1 if they are not in namespace ndn.

There are two potential workarounds:

One of these workarounds should be adopted.


Related issues 1 (0 open1 closed)

Related to NFD - Bug #2175: Compilation fails after ndn-cxx placeholders changeClosedJunxiao Shi11/13/2014

Actions
Actions

Also available in: Atom PDF