C++ 编码库 FunctionalPlus

码农软件 · 软件分类 · C/C++开发工具 · 2019-11-09 21:59:48

软件介绍

FunctionalPlus 是一个小的表头库,它可以降低代码噪声,一次只处理一个单一等级的的抽象对象。通过增加你的代码的简洁性和可维护性来提高生产效率和编码乐趣。从长远的角度来看,它可以通过提供易于使用的功能将你从实现控制的流中解放出来。

示例代码:

#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;
}

本文地址:https://www.codercto.com/soft/d/18644.html

在你身边,为你设计

在你身边,为你设计

腾讯公司用户研究与体验设计部 / 电子工业出版社 / 2013-1 / 69.00元

设计属于所有人,也意在为所有人使用,这既是设计的价值,也是设计的责任。本书内容包括:设计理念、设计方法、用户研究、体验设计、设计流程和工具,以及团队成长与管理等方面的知识与经验分享。一起来看看 《在你身边,为你设计》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

随机密码生成器
随机密码生成器

多种字符组合密码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码