SSO-23
SSO-23 copied to clipboard
Incorrect use of operator& in README.md
All over the README.md
file, there is code like :
CharT *data() {
return (m_capacity > buffer_size) ? m_data.ptr : &m_data.buffer;
}
Note that while the type of m_data.ptr
is indeed CharT *
, that of &m_data.buffer
is CharT **
, because the "name" of an array decays to a pointer to it's 0th element.
Either you want m_data.buffer
or you want &m_data.buffer[0]
(the latter seems be the idiom in some C++ code, for instance in A Tour of C++ By Bjarne himself).
I hope this error does not exist in the source code.