array::pointer
更新 : 2007 年 11 月
要素へのポインタの型です。
typedef Ty *pointer;
解説
この型は、シーケンスの要素へのポインタとして使用できるオブジェクトを表します。
使用例
// std_tr1__array__array_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::pointer ptr = &*c0.begin();
std::cout << " " << *ptr;
std::cout << std::endl;
return (0);
}
0 1 2 3
0
必要条件
ヘッダー : <array>
名前空間 : std::tr1