cpp-subprocess
cpp-subprocess copied to clipboard
Buffer class is badly designed and superfluous
The class Buffer has
std::vector<char> buf;
size_t length = 0;
This is a bad interface design because the length
field duplicates the buf.size()
. At what situations can those differ? Should they differ? It is not documented and unclear.
Furthermore, the class can (and arguably should) be replaced with std::string.
Hehe...yeah I agree its pretty bad. The original idea was to have something like asio buffers which users can later customize....but that never happened. For now I will just change it to use just plain STL.
@klosworks @arun11299 It seems that std::string
can be a good replacement for std::vector<char>
. Do you agree with me?