diff options
author | Sven Gothel <[email protected]> | 2021-10-21 08:02:18 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-10-21 08:02:18 +0200 |
commit | 56f02dab1196f94e1db041dfe720a18225841b8f (patch) | |
tree | 244fcc0ebec555be33116d05b543265fce8df0d5 | |
parent | 90ae4c9d55725697c1b16ac48d08fc171a48d2ec (diff) |
POctet copy-ctor API doc: Mention source.size() -> capacity of new instance
-rw-r--r-- | include/jau/octets.hpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/jau/octets.hpp b/include/jau/octets.hpp index 772041c..bc64d99 100644 --- a/include/jau/octets.hpp +++ b/include/jau/octets.hpp @@ -633,15 +633,19 @@ namespace jau { /** * Copy constructor - * @param _source POctet source to be copied + * + * Capacity of this new instance will be of source.size() only. + * + * @param source POctet source to be copied * @throws OutOfMemoryError if allocation fails */ - POctets(const POctets &_source) - : TOctets( allocData(_source.size()), _source.size(), _source.byte_order() ), - _capacity( _source.size() ) + POctets(const POctets &source) + : TOctets( allocData(source.size()), source.size(), source.byte_order() ), + _capacity( source.size() ) { - std::memcpy(data(), _source.get_ptr(), _source.size()); - TRACE_PRINT("POctets ctor-cpy0: %p", data()); + std::memcpy(data(), source.get_ptr(), source.size()); + TRACE_PRINT("POctets ctor-cpy0: %p -> %p", source.get_ptr(), data()); + } } /** |