C++相談室 part17
■ このスレッドは過去ログ倉庫に格納されています
0643デフォルトの名無しさん
NGNGfind_first_ofでいいのか?
std::list<std::string> f( std::istream& source , const char delimiter[] )
{
std::string all;
std::getline( source , all , '\0' );
std::list<std::string> lines;
if( !all.empty() )
{
std::string::size_type pos = 0;
do {
const std::string::size_type start = pos;
pos = all.find( delimiter , start );
lines.push_back( all.substr( start , pos ) );
} while ( pos != std::string::npos );
}
return lines;
}
■ このスレッドは過去ログ倉庫に格納されています