<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # decltype – 推斷表達式的數據類型 decltype(E)是一個標識符或者表達式的推斷數據類型(“declared type”),它可以用在變量聲明中作為變量的數據類型。例如: ``` void f(const vector<int>& a, vector<float>& b) { // 推斷表達式a[0]*b[0]的數據類型,并將其定義為Temp類型 typedef decltype(a[0]*b[0]) Tmp; // 使用Tmp作為數據類型聲明變量,創建對象 for (int i=0; i < b.size(); ++i) { Tmp* p = new Tmp(a[i]*b[i]); // … } // … } ``` 這個想法以“typeof”的形式已經在通用語言中流行很久了,但是,現在使用中的typeof的實現并沒有完成,并有一些兼容性問題,所以新標準將其命名為decltype。 如果你僅僅是想根據初始化值為一個變量推斷合適的數據類型,那么使用auto是一個更加簡單的選擇。當你只有需要推斷某個表達式的數據類型,例如某個函數調用表達式的計算結果的數據類型,而不是某個變量的數據類型時,你才真正需要delctype。 參考 ? the C++ draft 7.1.6.2 Simple type specifiers ? [Str02] Bjarne Stroustrup. Draft proposal for “typeof”. C++ reflector message c++std-ext-5364, October 2002\. (original suggestion). ? [N1478=03-0061] Jaakko Jarvi, Bjarne Stroustrup, Douglas Gregor, and Jeremy Siek: Decltype and auto (original proposal). ? [N2343=07-0203] Jaakko Jarvi, Bjarne Stroustrup, and Gabriel Dos Reis: Decltype (revision 7): proposed wording.
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看