Boost C++ 库

...世界上最受尊敬且设计最精湛的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu, C++ 编码标准

PrevUpHomeNext

buffer(42 个重载中的第 21 个)

创建一个新的不可修改的缓冲区,表示给定的 POD 向量。

template<
    typename PodType,
    typename Allocator>
const_buffer buffer(
    const std::vector< PodType, Allocator > & data);
返回值

一个等价于以下值的 const_buffer

const_buffer(
   data.size() ? &data[0] : 0,
   data.size() * sizeof(PodType));
备注

任何会使迭代器失效的向量操作都会使缓冲区失效。


PrevUpHomeNext