<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          C++核心準(zhǔn)則R.23: 使用make_unique構(gòu)建unique_ptr

          7c674e8641f87664c4dde1003d85a4b3.webp

          R.23: Use?make_unique()?to make?unique_ptrs

          R.23:?使用make_unique構(gòu)建unique_ptr


          Reason(原因)

          For convenience and consistency with?shared_ptr.

          出于習(xí)慣。保持和shared_ptr用法的一致性。


          Note(注意)

          make_unique()?is C++14, but widely available (as well as simple to write).

          make_unique()是C++14引入的功能,但是可以廣泛使用(也很容易自己寫一個(gè))


          Enforcement(實(shí)施建議)

          (Simple) Warn if a?unique_ptr?is constructed from the result of?new?rather than?make_unique.

          (簡單)如果unique_ptr從new得到的結(jié)果構(gòu)建而不是使用make_uinque,報(bào)警。


          原文鏈接

          https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#r23-use-make_unique-to-make-unique_ptrs



          覺得本文有幫助?請(qǐng)分享給更多人。

          關(guān)注微信公眾號(hào)【面向?qū)ο笏伎肌枯p松學(xué)習(xí)每一天!

          面向?qū)ο箝_發(fā),面向?qū)ο笏伎迹?/span>



          瀏覽 76
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  草草网| 日韩乱码人妻无码超清蜜桃丨 | 超碰AV青青草在线 | 精品xxxx| 亚洲电影在线播放 |