<see>
檔標籤
<see>
標記可讓您在文字內指定連結。 使用 <seealso>
來指出您可能想要出現在 [另請參閱] 區段中的文字。
語法
/// <see cref="member"/>
參數
member
可從目前編譯環境呼叫的成員或欄位參考。 以單引號或雙引號將名稱括起來。
編譯器會檢查指定的程式碼項目是否存在,並將 member
解析為輸出 XML 中的項目名稱。 如果 member
找不到 ,則編譯程式會發出警告。
備註
使用 /doc
編譯 以處理檔案的檔批注。
如需使用 <see>
的範例,請參閱 <summary>
。
MSVC 編譯程式會嘗試在一次傳遞檔批注中解析 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 {};