<see> ドキュメント タグ

<see> タグを使用すると、テキスト内からリンクを指定できます。 <seealso> を使用して、関連項目 セクションに表示するテキストを指定します。

構文

/// <see cref="member"/>

パラメーター

member
現在のコンパイル環境からの呼び出しに利用できる、メンバーまたはフィールドへの参照。 名前は、一重引用符または二重引用符で囲みます。

コンパイラは、指定されたコード要素が存在するかどうかを確認し、member を出力 XML 内の要素名に解決します。 コンパイラでは、member が見つからない場合に警告を発行します。

解説

コンパイル時に /doc を指定して、ドキュメント コメントをファイルに出力します。

<see> の使用例については、<summary> を参照してください。

MSVC コンパイラでは、ドキュメント コメントを通じて 1 回渡すことで cref 参照を解決しようとします。 C++ のルックアップ規則を使用しているときにコンパイラによってシンボルが見つからない場合、参照は未解決としてマークされます。 詳細については、「<seealso>」を参照してください。

次のサンプルでは、コンパイラで参照が解決されるよう、cref 参照をジェネリック型にする方法を確認できます。

// xml_see_cref_example.cpp
// compile with: /LD /clr /doc
// the following cref shows how to specify the reference, such that,
// the compiler will resolve the reference
/// <see cref="C{T}">
/// </see>
ref class A {};

// the following cref shows another way to specify the reference,
// such that, the compiler will resolve the reference
/// <see cref="C < T >"/>

// the following cref shows how to hard-code the reference
/// <see cref="T:C`1">
/// </see>
ref class B {};

/// <see cref="A">
/// </see>
/// <typeparam name="T"></typeparam>
generic<class T>
ref class C {};

関連項目

XML ドキュメント