array::const_pointer
更新 : 2007 年 11 月
要素への定数ポインタの型です。
typedef const Ty *const_pointer;
解説
この型は、シーケンスの要素への定数ポインタとして使用できるオブジェクトを表します。
使用例
// std_tr1__array__array_const_pointer.cpp
// compile with: /EHsc
#include <array>
#include <iostream>
typedef std::tr1::array<int, 4> Myarray;
int main()
{
Myarray c0 = {0, 1, 2, 3};
// display contents " 0 1 2 3"
for (Myarray::const_iterator it = c0.begin();
it != c0.end(); ++it)
std::cout << " " << *it;
std::cout << std::endl;
// display first element " 0"
Myarray::const_pointer ptr = &*c0.begin();
std::cout << " " << *ptr;
std::cout << std::endl;
return (0);
}
0 1 2 3
0
必要条件
ヘッダー : <array>
名前空間 : std::tr1