Fix compilation errors under C++11.

`std::string::data()` is const-only until C++17.

PiperOrigin-RevId: 479708109
This commit is contained in:
Matt Callanan
2022-10-08 03:11:32 +02:00
committed by qrczak
parent d644ca8770
commit 974fcc49e8
3 changed files with 3 additions and 3 deletions

View File

@@ -164,7 +164,7 @@ void BM_UIOVecSource(benchmark::State& state) {
struct iovec iov[kNumEntries];
size_t used_so_far = 0;
for (int i = 0; i < kNumEntries; ++i) {
iov[i].iov_base = contents.data() + used_so_far;
iov[i].iov_base = const_cast<char*>(contents.data()) + used_so_far;
if (used_so_far == contents.size()) {
iov[i].iov_len = 0;
continue;