Functional data structures in C++

后端 未结 2 1375
死守一世寂寞
死守一世寂寞 2020-12-14 07:45

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?

相关标签:
2条回答
  • 2020-12-14 08:19

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

    0 讨论(0)
  • 2020-12-14 08:28

    This is more of a heads up than a detailed answer, but Bartosz Milewski appears to have done a lot of work on this. See, for example:

    http://bartoszmilewski.com/2013/11/13/functional-data-structures-in-c-lists/

    Looks like he's implemented a lot of algorithms from Okasiki's book Purely Functional Data Structures here:

    https://github.com/BartoszMilewski/Okasaki

    N.B. I haven't tried these yet, but they're the first C++ persistent data structures I've seen outside of FC++.

    Hopefully, I'll get to trying them soon.

    0 讨论(0)
提交回复
热议问题