Boost.Filesystemライブラリを使用してディレクトリを反復処理しようとしています。
問題は、パスオブジェクトをインスタンス化しようとすると、「pippo」などの任意の長さの文字列で「stringotolong」というメッセージが表示されたstd::length_errorが発生することです。
私はすでにこれらすべてを試しました:
string s = "pippo";
path p(s);
path p(s.begin(), s.end());
path p(s.c_str());
path p("pippo");
私は、vc++10用のブーストプリコンパイル済みバージョン1.47を搭載したWindows7を使用しています。
よろしくお願いします、ルカ
編集
これは実行されたブーストコードです(path.hpp 129行目)
template <class Source>
path(Source const& source,
typename boost::enable_if<path_traits::is_pathable<
typename boost::decay<Source>::type> >::type* =0)
{
path_traits::dispatch(source, m_pathname, codecvt());
}
エラーは(path_traits.hpp行174)からスローされます
template <class U> inline
void dispatch(const std::string& c, U& to, const codecvt_type& cvt)
{
if (c.size())
convert(&*c.begin(), &*c.begin() + c.size(), to, cvt);
}
スローする関数は「変換」です。デバッガーから私は両方を見ました
&*c.begin()
と
&*c.begin() + c.size()
正しく実行されます