项目作者: ct-clmsn

项目描述 :
scrap your boilerplate plus plus
高级语言: C++
项目地址: git://github.com/ct-clmsn/sybpp.git
创建时间: 2021-02-16T03:28:56Z
项目社区:https://github.com/ct-clmsn/sybpp

开源协议:Boost Software License 1.0

下载


Scrap Your Boilerplate Plus Plus (sybpp)

Project details here.

This project implements functionality from Scrap Your Boilerplate: A Practical Design Pattern for Generic Programming, Lammel, Peyton-Jones, 2003.
The paper can be found here.

Scrap Your Boilerplate creates generic traversals over data types. Users identify a target type and provide a function that accepts
the identified type as an input parameter. sybpp computes, at compile-time, the generic traversal code. This removes the need for
users to implement “boilerplate” data structure traversal code (a visitor pattern) in order apply a function.

Notes

Users are required to wrap data types sybpp encounters with the BOOST_FUSION_ADAPT_STRUCT macro. Review the demo.cpp file for
code examples.

License

Boost Software License 1.0

Features

  • everywhere
  • one-layer traversal
  • recursive traversal
  • queries
  • transform
  • functions, functors, std::bind, lambdas supported
  • STL container types
  • supports std::variant, std::tuple, std::pair, std::optional

Special Thanks

Hartmut Kaiser for suggesting this paper.

Author

Christopher Taylor

Dependencies

  • C++17
  • Boost.Fusion