aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Seither <[email protected]>2015-06-20 18:29:44 +0200
committerDaniel Seither <[email protected]>2015-06-20 19:05:07 +0200
commit9dc9dd03af7f0f175c05ab9886f5e71d3d3a760d (patch)
tree298cefb880b2c0a2551b2a7d16aad3c5d0610c9c /src
parentf19604516c0138ffc240388073af2ce0735c48aa (diff)
lib/alloc: Convert &vec[0] to vec.data()
Diffstat (limited to 'src')
-rw-r--r--src/lib/alloc/secmem.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/alloc/secmem.h b/src/lib/alloc/secmem.h
index 6b3f8a487..b583aa812 100644
--- a/src/lib/alloc/secmem.h
+++ b/src/lib/alloc/secmem.h
@@ -97,7 +97,7 @@ template<typename T>
std::vector<T> unlock(const secure_vector<T>& in)
{
std::vector<T> out(in.size());
- copy_mem(&out[0], &in[0], in.size());
+ copy_mem(out.data(), in.data(), in.size());
return out;
}
@@ -118,7 +118,7 @@ size_t buffer_insert(std::vector<T, Alloc>& buf,
const std::vector<T, Alloc2>& input)
{
const size_t to_copy = std::min(input.size(), buf.size() - buf_offset);
- copy_mem(&buf[buf_offset], &input[0], to_copy);
+ copy_mem(&buf[buf_offset], input.data(), to_copy);
return to_copy;
}
@@ -129,7 +129,7 @@ operator+=(std::vector<T, Alloc>& out,
{
const size_t copy_offset = out.size();
out.resize(out.size() + in.size());
- copy_mem(&out[copy_offset], &in[0], in.size());
+ copy_mem(&out[copy_offset], in.data(), in.size());
return out;
}
@@ -167,7 +167,7 @@ std::vector<T, Alloc>& operator+=(std::vector<T, Alloc>& out,
template<typename T, typename Alloc>
void zeroise(std::vector<T, Alloc>& vec)
{
- clear_mem(&vec[0], vec.size());
+ clear_mem(vec.data(), vec.size());
}
/**