[filesystem] Custom memory allocator
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<char, char_traits<char>, tbb::scalable_allocator<char>
fast_string; struct fast_path_traits; typedef fs::basic_path<fast_string, fast_path_traits> 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_path> fast_directory_iterator;
Everything compiles until the point where I'd use operations: d = file_size<fast_path>(itr->path()); I get this error under VS2009: error C2770: invalid explicit template argument(s) for 'boost::enable_if<boost::filesystem::is_basic_path<Path>,boost::uintmax_t>::type boost::filesystem::file_size(const Path &)' Please help correcting it. Thanks, Dominic
participants (1)
-
Dominic Vandot