Deprecated: Array and string offset access syntax with curly braces is deprecated in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/init.php on line 542
ja:cpp:class [GiriWiki]

ユーザ用ツール

サイト用ツール


ja:cpp:class

以前のリビジョンの文書です



Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/parser/handler.php on line 1458

Warning: Declaration of syntax_plugin_note::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/lib/plugins/note/syntax.php on line 79

Warning: Declaration of syntax_plugin_note::render($mode, &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/lib/plugins/note/syntax.php on line 101

Warning: preg_match(): Compilation failed: invalid range in character class at offset 3120 in /mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/parser/lexer.php on line 118
A PCRE internal error occured. This might be caused by a faulty plugin

====== Classについて ====== ---- ===== 覚書 ===== * 親クラスでコンストラクタの中で仮想関数を使うのは危険 * 継承した子クラスのコンストラクタが呼ばれた時、親クラスのコンストラクタ->子クラスのコンストラクタという順で呼ばれる。 * 親クラスのコンストラクタで仮想関数が呼ばれる時、子クラスのコンストラクタはまだ呼ばれていないので、親クラスの関数が呼ばれることになる。 * つまり、子クラスでオーバーライドしているつもりの関数は呼ばれない。 * 親クラスで純粋仮想関数なんかにしておいた場合は定義されていない関数になるので、コンパイル(リンク)に失敗するはず。 * ので、親クラスの中で呼ぶのではなく、子クラスのコンストラクタの中で呼び出すべき。 * Initialize() みたいな関数を作った時など注意したほうがいいかも。

ja/cpp/class.1494668206.txt.gz · 最終更新: 2017/05/13 09:36 by kota