Skip to content

stream::write - should be implemented in terms of write(char*, int) #4

Description

@steve-lorimer

Duplication of code in write:

bool write(const std::vector<char>& buf, ...) and bool write(const std::string& buf, ...) should just defer to bool write(const char* buf, int len, ...)

    bool write(const std::string& buf, std::function<void(error)> callback)
    {
        return write(buf.c_str(), buf.length(), callback);
    }

    bool write(const std::vector<char>& buf, std::function<void(error)> callback)
    {
        return write(&buf[0], buf.size(), callback);
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions