<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 {};
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應