Giter Site home page Giter Site logo

doside / tiny-cpp-template-algorithm-library Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 402 KB

A C++14 template library for all kinds of grammar sugar.

License: MIT License

C++ 99.94% C 0.06%
metaprogramming c-plus-plus-14 grammar-sugar signal-slot-connection yet-another-xxx

tiny-cpp-template-algorithm-library's Introduction

这是一个正在开发中的未正式发布的header only的C++14模板库(MIT协议),所有.cpp文件均为测试文件,不需添加到项目中.
文档尚未完善,很多测试还没写好。license也没考虑好,可能会考虑使用MIT license。


设计目标:
糖化一切可糖化之物,简化编程。严格遵守ISO C++14。

当前主要组件:
类boost signal 2的事件信号库及其糖化设施、各种糟糕的元编程设施。

-----------------------------------------------------------------
基本特性:

变参选择:
get<id>(args...)
id为任意的size_t常量表达式。
超高效的get实现,对任意索引所需要的时间是一样的,也即间接调用是常数次,大概为2次。
它是便于调试的,并且比std::get+std::tuple这种朴素做法高效很多,
无论是运行时间还是编译时间。特别地,对于大量的参数来说使用make_tuple会直接导致编译崩溃,
而使用Talg::get则可以迅速通过编译。一般而论,在元编程中避免无谓地使用std::tuple可以
使编译速度得到提高。

参数萃取:
Transform_t<A<a,b,c,d>,B<e,f,g>>----> A<e,f,g>
有了transform就可以避免无谓的特化以及template template,从而节省编译时间。
当然最重要的是,它提供了极为便利的基本元编程要素,几乎所有元编程库都会有类似的功能
但目前却没人将该重要元语提炼抽象出来。

自动推导出默认的模板参数。
例如:As<std::map<int,int,default_t,Alloc>> 
可自动推导出default_t为std::less<int>,不依赖于任何特定模板
(此处使用map纯属巧合,该设施主要用于对付boost库里的一坨参数列表).
-----------------------------------------------------------------



当前支持的编译工具链:
VS2015 update3(MSVC14)
MINGW64 GCC4.9及后续版本。
NDK(clang3.8 or GCC4.9)


todo:
提供可以直接undef所有宏的头文件,并在所有使用了宏的文件的末尾使用之。
修正single list中的assign实现,当前被严重错误地实现为copy constructor了。
修正工程文件对具体路径的依赖,尤其是第三方库(用于编写测试)的设置。
添加自动修正项目设置的程序或脚本。
提供codeblock工程文件。
提供doxygen及cmake支持
添加文档主页面。
添加示例。
更换测试框架doctest为lest,重写所有测试用例。

tiny-cpp-template-algorithm-library's People

Contributors

doside avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.