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

          FunctionalPlusC++ 編碼庫(kù)

          聯(lián)合創(chuàng)作 · 2023-10-01 10:49

          FunctionalPlus 是一個(gè)小的表頭庫(kù),它可以降低代碼噪聲,一次只處理一個(gè)單一等級(jí)的的抽象對(duì)象。通過(guò)增加你的代碼的簡(jiǎn)潔性和可維護(hù)性來(lái)提高生產(chǎn)效率和編碼樂(lè)趣。從長(zhǎng)遠(yuǎn)的角度來(lái)看,它可以通過(guò)提供易于使用的功能將你從實(shí)現(xiàn)控制的流中解放出來(lái)。

          示例代碼:

          #include "FunctionalPlus/FunctionalPlus.h"#include <iostream>
          // std::list<std::uint64_t> CollatzSeq(std::uint64_t x) { ... }int main()
          {    using namespace FunctionalPlus;
              using namespace std;
          
              typedef list<uint64_t> Ints;    
              // [1, 2, 3 ... 29]
              auto numbers = GenerateIntegralRange<Ints>(1, 30);    
              // A function that does [1, 2, 3, 4, 5] -> "[1 => 2 => 3 => 4 => 5]"
              auto ShowInts = Bind1of2(ShowContWith<Ints>, " => ");    
              // A composed function that calculates a Collatz sequence and shows it.
              auto ShowCollatsSeq = Compose(CollatzSeq, ShowInts);    
              // Apply it to all our numbers.
              auto seqStrs = Transform(ShowCollatsSeq, numbers);    
              // Combine the numbers and their sequence representations into a map.
              auto collatzDict = CreateMap(numbers, seqStrs);    
              // Print some of the sequences.
              cout << collatzDict[13] << endl;
              cout << collatzDict[17] << endl;
          }
          瀏覽 12
          點(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>
                  黄色电影链接 | 欧美日韩手机在线观看 | 中文字幕在线无码视频 | 影音先锋AV一区二区三区四区 | va色婷婷亚洲在线 |