Project

General

Profile

Actions

Bug #2329

closed

Signal: emitSignal doesn't compile when used with non-zero-argument Signal

Added by Junxiao Shi over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Category:
Utils
Target version:
Start date:
12/25/2014
Due date:
% Done:

100%

Estimated time:
2.00 h

Description

Snippet to reproduce:

#include <ndn-cxx/util/signal.hpp>

using namespace ndn::util::signal;

class B
{
public:
  Signal<B, int> sig;

protected:
  DECLARE_SIGNAL_EMIT(sig)
};

class D1 : public B
{
public:
  void
  f1()
  {
    this->emitSignal(sig, 1);
  }
};

Compiler error:

In file included from /usr/local/include/ndn-cxx/util/signal.hpp:26:0,
                 from x.cpp:1:
x.cpp: In member function ‘void D1::f1()’:
x.cpp:22:11: error: no matching function for call to ‘D1::emit_sig(int, ndn::util::signal::DummyExtraArg)’
     this->emitSignal(sig, 1);
           ^
x.cpp:22:11: note: candidate is:
x.cpp:11:3: note: template<class ... TArgs> void B::emit_sig(const TArgs& ..., const ndn::util::signal::DummyExtraArg&)
   DECLARE_SIGNAL_EMIT(sig)
   ^
x.cpp:11:3: note:   template argument deduction/substitution failed:
x.cpp:22:11: note:   cannot convert ‘1’ (type ‘int’) to type ‘const ndn::util::signal::DummyExtraArg&’
     this->emitSignal(sig, 1);
           ^

Related issues 1 (0 open1 closed)

Blocks NFD - Task #2300: Face: use SignalClosedJunxiao Shi

Actions
Actions #1

Updated by Junxiao Shi over 9 years ago

Actions #2

Updated by Junxiao Shi over 9 years ago

  • Status changed from New to In Progress
Actions #3

Updated by Junxiao Shi over 9 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100
Actions #4

Updated by Junxiao Shi over 9 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF