<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>

          boolinq語(yǔ)言集成查詢模板庫(kù)

          聯(lián)合創(chuàng)作 · 2023-09-28 17:58

          boolinq 是用C++實(shí)現(xiàn)的語(yǔ)言集成查詢模板庫(kù),支持STL/Qt 集合類。

          用實(shí)例說(shuō)話:

           

          int src[] = {1,2,3,4,5,6,7,8};
          auto dst = from(src).where( [](int a){return a%2 == 1;})    // 1,3,5,7
                              .select([](int a){return a*2;})         // 2,6,10,14
                              .where( [](int a){return a>2 && a<12;}) // 6,10
                              .toVector();
          
          // dst type: std::vector// dst items: 6,10
          struct Man
          {
              std::string name;
              int age;
          };
          
          Man src[] =
          {
              {"Kevin",14},
              {"Anton",18},
              {"Agata",17},
              {"Terra",20},
              {"Layer",15},
          };
          
          auto dst = from(src).where(  [](const Man & man){return man.age < 18;})
                              .orderBy([](const Man & man){return man.age;})
                              .select( [](const Man & man){return man.name;})
                              .toVector();
          
          // dst type: std::vector// dst items: "Kevin", "Layer", "Agata"
          瀏覽 23
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <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>
                  欧美三级在线播放 | 麻豆精品国产 | 波多野结衣做爱视频 | 看大黄美女全裸大黄 | 成人三级片在线观看 |