Actions
Bug #2660
closedExclude::excludeOne: incorrect for default-constructed Name::Component
Start date:
03/20/2015
Due date:
% Done:
100%
Estimated time:
1.00 h
Description
Snippet to reproduce:
// g++ -std=c++0x x.cpp $(pkg-config --cflags --libs libndn-cxx)
#include <ndn-cxx/name.hpp>
#include <ndn-cxx/exclude.hpp>
using ndn::Name;
using ndn::Exclude;
int
main()
{
std::cout << (Name::Component() == Name::Component("") ? 1 : 0) << std::endl;
std::cout << Name::Component() << std::endl;
std::cout << Name::Component("") << std::endl;
std::cout << (Exclude().excludeOne(Name::Component()) == Exclude().excludeOne(Name::Component("")) ? 1 : 0) << std::endl;
std::cout << Exclude().excludeOne(Name::Component()) << std::endl;
std::cout << Exclude().excludeOne(Name::Component("")) << std::endl;
return 0;
}
Expected output:
1
...
...
1
...
...
Actual output:
1
...
...
0
...
Despite that Name::Component()
equals Name::Component("")
, Exclude::excludeOne
is treating them differently.
Actions