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.
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
Please post the snippet that instanciates this template and causes this error.
Indicate the type of each variable in that snippet.
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.
- 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.
- Status changed from New to In Progress
- Status changed from In Progress to Code review
- % Done changed from 0 to 100
- Status changed from Code review to Closed
Also available in: Atom
PDF