Question: I have this function I am trying to make the second argument in the function into a const string &. Is there a way i

I have this function

I have this function I am trying to make the second argument

I am trying to make the second argument in the function into a const string &. Is there a way i can do this and return same results? If not just say no.I tried to convert it const string & but cant because of the copy ().

std::string::const_iterator refillBuffer(std::string::const_iterator pc, std::string& buffer, long& totalBytes) { // find number of unprocessed characters [pc, buffer.cend()) auto d = std:: distance(pc, buffer.cend()); // move unprocessed characters, [PC, buffer.cend()), to start of the buffer std::copy (pc, buffer.cendo, buffer.begin(); == (ssize_t) -1) && // read in trying to read whole blocks ssize_t numbytes = 0; const int BUFFER_SIZE = 16 * 16 * 4096; while (((numbytes = READ(0, (void) (buffer.data() + a), (size_t) (BUFFER_SIZE - d))) (errno == EINTR)) { } // error in read if (numbytes == -1) return buffer.cend(); // EOF if (numbytes == 0) return buffer.cend(); + if ((std::string:: size_type) (numbytes buffer.resize(numbytes + d); d)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!