Project

General

Profile

Actions

Bug #2490

closed

Build error in template<typename InputIterator> name::Component::Component(InputIterator,InputIterator)

Added by Anonymous almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Base
Target version:
Start date:
02/07/2015
Due date:
% Done:

100%

Estimated time:

Description

name-component.hpp:621:11: error: no matching function for call to 'dataBlock'
  : Block(dataBlock(tlv::NameComponent, begin, end))

Full constructor:

template<class InputIterator>
inline
Component::Component(InputIterator begin, InputIterator end)
  : Block(dataBlock(tlv::NameComponent, begin, end))
{
}

Not sure when this was introduced, but present in current HEAD 23989111a28af77372578acab5bd69342a1760e1

Actions #1

Updated by Junxiao Shi almost 10 years ago

  • Category set to Base

Please post the snippet that instanciates this template and causes this error.

Indicate the type of each variable in that snippet.

Actions #2

Updated by Anonymous almost 10 years ago

I deleted the code that was using this constructor because I was doing something else wrong. Here's a minimal program that fails to compile:

#include <ndn-cxx/name-component.hpp>

int
main()
{
  std::vector<uint8_t> bytes = {1};
  ndn::name::Component c(bytes.begin(), bytes.end());

  return 0;
}

It produces a slightly different compilation error:

/usr/local/include/ndn-cxx/name-component.hpp:621:11: error: use of undeclared identifier 'dataBlock'
  : Block(dataBlock(tlv::NameComponent, begin, end))
          ^

The takeaway point is that there's no such thing as dataBlock in name-component.hpp. Not sure what the author was trying to call.

Actions #3

Updated by Junxiao Shi almost 10 years ago

  • Subject changed from Compilation error due to bad templated name::Component constructor to Build error in template<typename InputIterator> name::Component::Component(InputIterator,InputIterator)
  • Assignee set to Alex Afanasyev
  • Target version set to v0.3

dataBlock function template appears in encoding/block-helpers.hpp:

template<class InputIterator>
inline Block
dataBlock(uint32_t type, InputIterator first, InputIterator last);

But this function template was commented out in commit:258ec2bf9db653fe5890f3cf4cc7d3d51d5a953b.

Assigning to @Alex who authored the offending commit.

Actions #4

Updated by Alex Afanasyev almost 10 years ago

  • Status changed from New to In Progress
Actions #5

Updated by Alex Afanasyev almost 10 years ago

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

Updated by Alex Afanasyev almost 10 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF