[ad_1]
So in my code, I’ve used a method is_empty()in the boost library. I know is_empty
has two definitions, one is in the filesystem library of boost:
std::filesystem:is_empty(const std::filesystem::path& p)
.
And another is in std::integral_constant:
inline constexpr bool is_empty_v = is_empty<T>::value
;
I intended to use the one that is in the boost library, but how can I do it? I tried to not do using namespace std
at the beginning. Instead, every time I need to cout
, I’d use std::cout
to avoid the possible ambiguous on my is_empty
method. But I still got the same error if I do this. Is there any other way that can resolve this misconception? I attached part of my code snippet below. Thank you!
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "boost/filesystem.hpp"
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
...
using namespace boost::filesystem;
using namespace cv;
... inside main() function:
...
directory_iterator itr(param.referFolder);
if( is_empty(itr->path()) )
{
std::cout << "ERROR: ReferenceFolder is empty. Please place reference images inside." << std::endl;
return 1;
}
... ...
for(directory_iterator itr(param.dataFolder); itr != end_itr; ++itr) // search every folder
{
if(is_directory(itr->status()) && !is_empty(itr->path())){
... ...
}
}
[ad_2]