summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorHossein <hossein@libreoffice.org>2021-10-18 21:16:28 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-10-25 09:08:37 +0200
commit1fd620d06d851808dc4d8dce066387b96bf43c9a (patch)
tree4b290aa01c5c412cb602e2ca7cde93207fd4db17 /configure.ac
parent4a8aed2940040e8b8f0db0f06cb06a757cd06a9a (diff)
Replacing std::unique_ptr<char[]>
* Replacing std::unique_ptr<char[]> with std::vector<char> * The data bytes are read into the vector internal storage * Modification of the internal storage of the vector using the pointer returned by data() is allowed by the standard C++ Standard, revision n4830, section 2.3.11.4 Data [vector.data] Returns: A pointer such that [data(), data() + size()) is a valid range. For a non-emptyvector, data() == addressof(front()). https://github.com/cplusplus/draft/blob/main/papers/n4835.pdf * It could be replaced with std::string when data is not modified Example: 6c13e5a92ed4b6a10458cd5d5741ddb3d816df4e * std::vector<char> is useful when working with C functions that get "char *" for writing data. In this case, std::string is not usable, because data() method for it returns "const char *". Change-Id: Ife6013b16a1803c3ad7b0c64aa0cb4c8cf4373ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123764 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'configure.ac')
0 files changed, 0 insertions, 0 deletions