I needed a function to get the absolute path and for that purpose I had a look in boost but it only has that in recent version and I'm using an old 1.44. As I cannot update my code on recent boost 1.55 or higher, I decided to re-write that function. It worked fine on Windows but I'm getting in an infinite recursion under Linux and I cannot understand why ? That code is based on the description you can find here
All advice to fix that issue will be welcome ! Thanks
#include "boost/filesystem.hpp"
namespace bfs = boost::filesystem;
inline bfs::path absolute(const bfs::path& p, const bfs::path& base=bfs::current_path())
{
if(p.has_root_directory())
{
if(p.has_root_name()) return p;
else return absolute(base).root_name() / p;
}
else
{
if(p.has_root_name()) return bfs::path(p.root_name()) / bfs::path(absolute(base).root_directory()) / absolute(base).relative_path() / p.relative_path();
else return absolute(base) / p;
}
}