Skip to content

ct-clmsn/sybpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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