All,
I'd like to use filesystem::path with a custom memory allocator (I need to
allocate and free millions of paths in cycles from multiple threads). As far
as I understand only the underlying string type can have a custom allocator.
I created these typedefs:
typedef basic_string
fast_string;
struct fast_path_traits;
typedef fs::basic_path fast_path;
struct fast_path_traits {
typedef fast_string internal_string_type;
typedef fast_string external_string_type;
static external_string_type to_external( const fast_path &,
const internal_string_type & src ) { return src; }
static internal_string_type to_internal(
const external_string_type & src ) { return src; }
};
typedef basic_directory_iterator fast_directory_iterator;
Everything compiles until the point where I'd use operations:
d = file_size(itr->path());
I get this error under VS2009:
error C2770: invalid explicit template argument(s) for
'boost::enable_if::type
boost::filesystem::file_size(const Path &)'
Please help correcting it.
Thanks,
Dominic