内容へ移動
C++プログラマのためのC++/CLI入門
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
現在位置:
TOP
»
cli
»
indexed_property
cli:indexed_property
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
{{indexmenu_n>18}} ====== indexed property ====== indexed propertyはC++のoperator[]のようなものです。 <code cpp> ref class C { array<double>^ d; public: C() { d = gcnew array<double>(10); } property double default[int] { double get(int i) { return d[i]; } void set(int i, double t) { d[i] = t; } } }; int main() { C c; c[5] = 5; double d = c[5]; } </code> propertyにgetメソッドを定義しなければ、書き込みオンリーにすることもできます。
/var/www/html/virtual/cppcli/data/pages/cli/indexed_property.txt
· 最終更新: 2013/12/23 09:08 (外部編集)
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ