boost vc6 使用filesystem时,文件err_code.hpp编译通不过(使用模板) 敬请各位高手能不吝赐教!
问题如题目。补充一下:最近在使用boost,使用了filesystem类库。
引用头文件:#include "boost/filesystem/operations.hpp"
#include "boost/filesystem/path.hpp"
源代码://先测试使用filesystem有没有问题,程序主体未完成
namespace fs = boost::filesystem;
// get the path
if (strPath.size() < 2)
{
return;
}
fs::path full_path(fs::initial_path());
full_path = fs::system_complete(fs::current_path(strPath,fs::native));
unsigned long file_count = 0;
unsigned long dir_count = 0;
unsigned long err_count = 0;
if (!fs::exists( full_path ))
{
//TODO
}
但在编译时,在err_code.hpp文件中出现了大量错误:
c:\boost\include\boost-1_35\boost\system\error_code.hpp(45) : error C2252: 'value' : pure specifier can only be specified for functions
c:\boost\include\boost-1_35\boost\system\error_code.hpp(45) : see reference to class template instantiation 'boost::system::is_error_code_enum<T>' being compiled
c:\boost\include\boost-1_35\boost\system\error_code.hpp(48) : error C2252: 'value' : pure specifier can only be specified for functions
c:\boost\include\boost-1_35\boost\system\error_code.hpp(48) : see reference to class template instantiation 'boost::system::is_error_condition_enum<T>' being compiled
c:\boost\include\boost-1_35\boost\system\error_code.hpp(144) : error C2258: illegal pure syntax, must be '= 0'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(144) : error C2252: 'value' : pure specifier can only be specified for functions
c:\boost\include\boost-1_35\boost\system\error_code.hpp(227) : error C2039: 'type' : is not a member of 'enable_if<struct boost::system::is_error_condition_enum<Cond>,void>'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(241) : error C2039: 'type' : is not a member of 'enable_if<struct boost::system::is_error_condition_enum<Cond>,class boost::system::error_condition>'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(294) : error C2784: 'struct boost::type &__thiscall boost::system::error_condition::operator =(ConditionEnum)' : could not deduce template argument for 'struct boost::type &' from 'class boost:
:system::error_condition &'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(294) : error C2785: 'struct boost::type &__thiscall boost::system::error_condition::operator =(ConditionEnum)' and 'class boost::system::error_condition &__thiscall boost::system::error_conditi
on::operator =(const class boost::system::error_condition &)' have different return types
c:\boost\include\boost-1_35\boost\system\error_code.hpp(242) : see declaration of '='
c:\boost\include\boost-1_35\boost\system\error_code.hpp(314) : error C2039: 'type' : is not a member of 'enable_if<struct boost::system::is_error_code_enum<Cond>,void>'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(327) : error C2039: 'type' : is not a member of 'enable_if<struct boost::system::is_error_code_enum<Cond>,class boost::system::error_code>'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(381) : error C2784: 'struct boost::type &__thiscall boost::system::error_code::operator =(CodeEnum)' : could not deduce template argument for 'struct boost::type &' from 'class boost::system::e
rror_code &'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(381) : error C2785: 'struct boost::type &__thiscall boost::system::error_code::operator =(CodeEnum)' and 'class boost::system::error_code &__thiscall boost::system::error_code::operator =(const
class boost::system::error_code &)' have different return types
c:\boost\include\boost-1_35\boost\system\error_code.hpp(328) : see declaration of '='
c:\boost\include\boost-1_35\boost\system\error_code.hpp(389) : error C2143: syntax error : missing ';' before '}'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(395) : error C2143: syntax error : missing ';' before '}'
c:\boost\include\boost-1_35\boost\system\error_code.hpp(445) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...
我使用的是vc6,敬请各位高手能不吝赐教,解决这个问题。