programming language
Révision | 21d7bceb509dc16f0a6346388c41a9fcf63922e6 (tree) |
---|---|
l'heure | 2020-11-23 19:54:56 |
Auteur | dhrname <dhrname@user...> |
Commiter | dhrname |
Modify the comment
@@ -28,7 +28,27 @@ | ||
28 | 28 | |
29 | 29 | /*Nodeの抽象クラス |
30 | 30 | * 5方向リンクのリスト |
31 | - * これを型として使う。*/ | |
31 | + * これを型として使う。 | |
32 | + * | |
33 | + *使用例 | |
34 | + * Node* a = node<float>(1.0); | |
35 | + * a.appendChild(node<int>(1)); | |
36 | + * a.appendChild(node<std::string>("hoge")); | |
37 | + * | |
38 | + * while (a->isNode()) | |
39 | + * { | |
40 | + * if ( a->isCaseOf(typeid(int)) ) | |
41 | + * { | |
42 | + * int num = a->getValue(); | |
43 | + * } | |
44 | + * else if ( a->isCaseOf(typeid(std::string)) ) | |
45 | + * { | |
46 | + * std::string str = a->getValue(); | |
47 | + * } | |
48 | + * } | |
49 | + * なお、isCaseOfメンバ関数の名前の由来は、ダイクストラ、ホーア、ウィルトたちが、 | |
50 | + * 熟慮したうえで生み出したcase...of...文である。 | |
51 | + **/ | |
32 | 52 | class Node |
33 | 53 | { |
34 | 54 | public: |