Functional data structures in C++(C++中的函数式数据结构)
问题描述
有谁知道 C++ 数据结构库提供熟悉的 STL 结构的功能(也称为不可变,或 FP 意义上的持久")等价物?
Does anyone know of a C++ data structure library providing functional (a.k.a. immutable, or "persistent" in the FP sense) equivalents of the familiar STL structures?
功能性"是指对象本身是不可变的,而对这些对象的修改会返回与父对象在适当情况下共享相同内部结构的新对象.
By "functional" I mean that the objects themselves are immutable, while modifications to those objects return new objects sharing the same internals as the parent object where appropriate.
理想情况下,这样的库应该类似于 STL,并且可以很好地与 Boost.Phoenix 一起使用(警告-我实际上并没有使用过 Phoenix,但据我所知它提供了许多算法但没有数据结构,除非懒惰的- 对现有数据结构的计算更改很重要 - 是吗?)
Ideally, such a library would resemble STL, and would work well with Boost.Phoenix (caveat- I haven't actually used Phoenix, but as far as I can tell it provides many algorithms but no data structures, unless a lazily-computed change to an existing data structure counts - does it?)
推荐答案
我会看看是否FC++ 包括任何数据结构.当然,这个项目比其他任何项目都更关注支持 C++ 中的函数式风格.
I would look and see whether FC++ developed by Yannis Smaragdakis includes any data structures. Certainly this project more than any other is about supporting a functional style in C++.
这篇关于C++中的函数式数据结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:C++中的函数式数据结构
基础教程推荐
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- CString 到 char* 2021-01-01
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 初始化列表*参数*评估顺序 2021-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
