Does valarray have contiguous memory alignment?

后端 未结 1 1630
自闭症患者
自闭症患者 2020-12-20 18:36

Does valarray have contiguous memory alignment?

I want to pass a valarray to a function (from IPPS), which only takes pointers, by passing &

相关标签:
1条回答
  • 2020-12-20 19:11

    Assuming you're asking whether the memory managed by a valarray is guaranteed to be contiguous, then the answer is yes, at least if the object isn't const (C++03, §26.3.2.3/3 or C++11, §26.6.2.4/2):

    The expression &a[i+j] == &a[i] + j evaluates as true for all size_t i and size_t j such that i+j is less than the length of the non-constant array a.

    0 讨论(0)
提交回复
热议问题