First of all, it seems that you've got a using namespace std;
somewhere in your code. Don't do that Don't do that. (No, really No, really).
Here's a function that should meet your needs.
static std::string Read(std::istream &stream, std::string::size_type count)
{
std::string out;
out.reserve(count);
std::copy_n(std::istreambuf_iterator(stream), count, std::back_inserter(out));
return out;
}
First of all, it seems that you've got a using namespace std;
somewhere in your code. Don't do that. (No, really).
Here's a function that should meet your needs.
static std::string Read(std::istream &stream, std::string::size_type count)
{
std::string out;
out.reserve(count);
std::copy_n(std::istreambuf_iterator(stream), count, std::back_inserter(out));
return out;
}
First of all, it seems that you've got a using namespace std;
somewhere in your code. Don't do that. (No, really).
Here's a function that should meet your needs.
static std::string Read(std::istream &stream, std::string::size_type count)
{
std::string out;
out.reserve(count);
std::copy_n(std::istreambuf_iterator(stream), count, std::back_inserter(out));
return out;
}
First of all, it seems that you've got a using namespace std;
somewhere in your code. Don't do that. (No, really).
Here's a function that should meet your needs.
static std::string Read(std::istream &stream, uint32_tstd::string::size_type count)
{
std::string out;
out.reserve(count);
std::copy_n(std::istreambuf_iterator(stream), count, std::back_inserter(out));
return out;
}
First of all, it seems that you've got a using namespace std;
somewhere in your code. Don't do that. (No, really).
Here's a function that should meet your needs.
static std::string Read(std::istream &stream, uint32_t count)
{
std::string out;
out.reserve(count);
std::copy_n(std::istreambuf_iterator(stream), count, std::back_inserter(out));
return out;
}
First of all, it seems that you've got a using namespace std;
somewhere in your code. Don't do that. (No, really).
Here's a function that should meet your needs.
static std::string Read(std::istream &stream, std::string::size_type count)
{
std::string out;
out.reserve(count);
std::copy_n(std::istreambuf_iterator(stream), count, std::back_inserter(out));
return out;
}
First of all, it seems that you've got a using namespace std;
somewhere in your code. Don't do that. (No, really).
Here's a function that should meet your needs.
static std::string Read(std::istream &stream, uint32_t count)
{
std::string out;
out.reserve(count);
std::copy_n(std::istreambuf_iterator(stream), count, std::back_inserter(out));
return out;
}