Consider the following program:
#include <iostream>
#include "boost/filesystem.hpp"
int main()
{
boost::filesystem::directory_entry d("test.txt");
boost::filesystem::directory_entry e("test.txt");
if (d == e) {
std::cout << "equal" << std::endl;
}
return 0;
}
This fails to compile (Visual Studio 2005, Windows XP SP3) with 17 variants of this error:
error C2784: 'bool std::operator ==(const std::stack<_Ty,_Container> &,
const std::stack<_Ty,_Container> &)' :
could not deduce template argument for
'const std::stack<_Ty,_Container> &' from
'boost::filesystem::directory_entry'
According to the documentation (I still use Boost 1.45), there are comparison operators defined for directory_entry, but neither I nor the compiler can find them (I checked the headers manually). Am I missing something? Maybe I made a mistake when creating boost, perhaps by setting some parameter that disables these operators? Invalid documentation? Can someone explain?
source
share