The Wayback Machine - https://web.archive.org/web/20120702145014/http://ja.cppreference.com:80/w/cpp/language
名前空間
変種
操作

C++言語

提供:cppreference.com
< cpp


ここは利用可能なC++構造の簡単なリファレンスです。

目次

[編集] 一般トピック

[編集] フロー制御

[編集] 条件実行文

与えられた式の値に応じて異なるコードパスが実行されます。

  • if 条件付きでコードを実行します。
  • switch 整数引数の値によってコードを実行します。

[編集] 繰り返し文

同じコードを複数回実行します。

  • for ループ実行します。
  • while ループ実行します。各々の繰り返しの前に条件をチェックします。
  • do ループ実行します。各々の繰り返しの後に条件をチェックします。

[編集] ジャンプ文

残されたコードを無視して異なる位置から実行を継続します。

  • continue continueを囲っているループ本体の残りの部分をスキップします。
  • break breakを囲っているループを終了します。
  • goto 別の位置から実行を継続します。
  • return returnを囲っている関数の実行を終了します。

[編集] 関数

同じコードをプログラムの異なる部分から再利用できます。

[編集] 例外

例外は、グローバルエラー変数や関数戻り値を使った方法とくらべ、より堅固なエラー状態通知手段です。

[編集] 名前空間

Namespaces provide a way to prevent name clashes in large projects

[編集]

[編集] 指定子

[編集] 演算子

  • operators allows using syntax commonly found in mathematics

{{page>/language/template_operator_groups}}

[編集] ユーティリティ


[編集] クラス

Classes provide object-oriented programming concept to C++.

[編集] 特殊メンバ関数

  • default constructor initializes the object with default contents
  • copy constructor initializes the object with the contents of another object
  • move constructor initializes the object with the contents of other, temporary object, minimizing copying overhead (C++11 feature)
  • assignment operator replaces the contents of the object with the contents of another object
  • move assignment operator replaces the contents of the object with the contents of other, temporary object, minimizing copying overhead (C++11 feature)
  • destructor releases claimed resources


[編集] テンプレート

Templates provide a way to apply the same algorithms to different types.