久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<small id='i2fdP'></small><noframes id='i2fdP'>

    <bdo id='i2fdP'></bdo><ul id='i2fdP'></ul>
<legend id='i2fdP'><style id='i2fdP'><dir id='i2fdP'><q id='i2fdP'></q></dir></style></legend>
    <tfoot id='i2fdP'></tfoot>

  1. <i id='i2fdP'><tr id='i2fdP'><dt id='i2fdP'><q id='i2fdP'><span id='i2fdP'><b id='i2fdP'><form id='i2fdP'><ins id='i2fdP'></ins><ul id='i2fdP'></ul><sub id='i2fdP'></sub></form><legend id='i2fdP'></legend><bdo id='i2fdP'><pre id='i2fdP'><center id='i2fdP'></center></pre></bdo></b><th id='i2fdP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='i2fdP'><tfoot id='i2fdP'></tfoot><dl id='i2fdP'><fieldset id='i2fdP'></fieldset></dl></div>

    1. 來自元組的構造函數參數

      Constructor arguments from tuple(來自元組的構造函數參數)
          <i id='Z8nhJ'><tr id='Z8nhJ'><dt id='Z8nhJ'><q id='Z8nhJ'><span id='Z8nhJ'><b id='Z8nhJ'><form id='Z8nhJ'><ins id='Z8nhJ'></ins><ul id='Z8nhJ'></ul><sub id='Z8nhJ'></sub></form><legend id='Z8nhJ'></legend><bdo id='Z8nhJ'><pre id='Z8nhJ'><center id='Z8nhJ'></center></pre></bdo></b><th id='Z8nhJ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Z8nhJ'><tfoot id='Z8nhJ'></tfoot><dl id='Z8nhJ'><fieldset id='Z8nhJ'></fieldset></dl></div>
            <tbody id='Z8nhJ'></tbody>
          <legend id='Z8nhJ'><style id='Z8nhJ'><dir id='Z8nhJ'><q id='Z8nhJ'></q></dir></style></legend>

            <tfoot id='Z8nhJ'></tfoot>
            • <bdo id='Z8nhJ'></bdo><ul id='Z8nhJ'></ul>

                <small id='Z8nhJ'></small><noframes id='Z8nhJ'>

                本文介紹了來自元組的構造函數參數的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                假設我有一個模板,它由一個類類型和許多參數類型參數化.匹配這些類型的一組參數存儲在一個元組中.如何將這些傳遞給類類型的構造函數?

                Suppose I have a template which is parametrized by a class type and a number of argument types. a set of arguments matching these types are stored in a tuple. How can one pass these to a constructor of the class type?

                幾乎在 C++11 代碼中:

                In almost C++11 code:

                template<typename T, typename... Args>
                struct foo {
                  tuple<Args...> args;
                  T gen() { return T(get<0>(args), get<1>(args), ...); }
                };
                

                如何在不固定長度的情況下填充構造函數調用中的...?

                How can the ... in the constructor call be filled without fixing the length?

                我想我可以想出一些復雜的遞歸模板調用機制來做到這一點,但我不敢相信我是第一個想要這個的人,所以我想會有現成的解決方案這在那里,甚至可能在標準庫中.

                I guess I could come up with some complicated mechanism of recursive template calls which does this, but I can't believe that I'm the first to want this, so I guess there will be ready-to-use solutions to this out there, perhaps even in the standard libraries.

                推薦答案

                C++17 有 std::make_from_tuple 為此:

                C++17 has std::make_from_tuple for this:

                template <typename T, typename... Args>
                struct foo
                {
                  std::tuple<Args...> args;
                  T gen() { return std::make_from_tuple<T>(args); }
                };
                

                這篇關于來自元組的構造函數參數的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Why do two functions have the same address?(為什么兩個函數的地址相同?)
                Why the initializer of std::function has to be CopyConstructible?(為什么 std::function 的初始化程序必須是可復制構造的?)
                mixing templates with polymorphism(混合模板與多態性)
                When should I use the keyword quot;typenamequot; when using templates(我什么時候應該使用關鍵字“typename?使用模板時)
                Dependent name resolution amp; namespace std / Standard Library(依賴名稱解析命名空間 std/標準庫)
                gcc can compile a variadic template while clang cannot(gcc 可以編譯可變參數模板,而 clang 不能)

                  • <legend id='1knY5'><style id='1knY5'><dir id='1knY5'><q id='1knY5'></q></dir></style></legend>
                  • <i id='1knY5'><tr id='1knY5'><dt id='1knY5'><q id='1knY5'><span id='1knY5'><b id='1knY5'><form id='1knY5'><ins id='1knY5'></ins><ul id='1knY5'></ul><sub id='1knY5'></sub></form><legend id='1knY5'></legend><bdo id='1knY5'><pre id='1knY5'><center id='1knY5'></center></pre></bdo></b><th id='1knY5'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='1knY5'><tfoot id='1knY5'></tfoot><dl id='1knY5'><fieldset id='1knY5'></fieldset></dl></div>
                    <tfoot id='1knY5'></tfoot>

                        <tbody id='1knY5'></tbody>

                      <small id='1knY5'></small><noframes id='1knY5'>

                        • <bdo id='1knY5'></bdo><ul id='1knY5'></ul>
                          主站蜘蛛池模板: 色啪网 | 黄色一级毛片 | 中文在线一区二区 | 男女网站免费观看 | 久久com| 亚洲综合无码一区二区 | 国产精品久久久久久久免费大片 | 在线激情视频 | 久久久成人一区二区免费影院 | 日韩免费在线观看视频 | 北条麻妃99精品青青久久 | 正在播放国产精品 | 日本欧美国产在线观看 | 九九久久在线看 | 国产精品福利在线 | 黄网站在线播放 | 99av成人精品国语自产拍 | 欧美日韩黄| 欧美精品综合 | 国产1区 | 香蕉婷婷 | 日韩在线免费观看视频 | 91视频免费黄 | 国产乱码精品1区2区3区 | 欧美在线观看一区 | 日本不卡一区二区三区在线观看 | 在线亚洲精品 | 亚洲视频在线播放 | 久久爱综合 | 久久久久国产精品人 | 午夜影院在线观看 | 美日韩一区二区 | 午夜精品视频在线观看 | 久久精品色视频 | 在线观看 亚洲 | 可以免费看的毛片 | 亚洲女人天堂成人av在线 | 欧美日批| 午夜久久久久久久久久一区二区 | 欧美日韩国产欧美 | 九九九久久国产免费 |