Boost C++ Libraries Home Libraries People FAQ More

Next

Chapter 1. Boost.Proto

Eric Niebler

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Table of Contents

Preface
Users' Guide
Getting Started
Installing Proto
Naming Conventions
Hello World
Hello Calculator
Fronts Ends: Defining Terminals and Non-Terminals of Your DSEL
Making Terminals
Proto's Operator Overloads
Making Lazy Functions
Adding Members by Extending Expressions
Domains
The extends<> Expression Wrapper
Expression Generators
Controlling Operator Overloads
Adapting Existing Types to Proto
Generating Repetitive Code with the Preprocessor
Intermediate Form: Understanding and Introspecting Expressions
Accessing Parts of an Expression
Deep-copying Expressions
Debugging Expressions
Operator Tags and Metafunctions
Expressions as Fusion Sequences
Expression Introspection: Defining a Grammar
Finding Patterns in Expressions
Fuzzy and Exact Matches of Terminals
if_<>, and_<>, and not_<>
Improving Compile Times With switch_<>
Matching Vararg Expressions
Defining DSEL Grammars
Back Ends: Making Expression Templates Do Useful Work
Expression Evaluation: Imparting Behaviors with a Context
Evaluating an Expression with proto::eval()
Defining an Evaluation Context
Proto's Built-In Contexts
Expression Transformation: Semantic Actions
Activating” Your Grammars
Handling Alternation and Recursion
Callable Transforms
Object Transforms
Example: Calculator Arity
Transforms With State Accumulation
Passing Auxiliary Data to Transforms
Proto's Built-In Transforms
Building Custom Primitive Transforms
Making Your Transform Callable
Examples
Hello World: Building an Expression Template and Evaluating It
Calc1: Defining an Evaluation Context
Calc2: Adding Members Using proto::extends<>
Calc3: Defining a Simple Transform
Lazy Vector: Controlling Operator Overloads
RGB: Type Manipulations with Proto Transforms
TArray: A Simple Linear Algebra Library
Vec3: Computing With Transforms and Contexts
Vector: Adapting a Non-Proto Terminal Type
Mixed: Adapting Several Non-Proto Terminal Types
Map Assign: An Intermediate Transform
Future Group: A More Advanced Transform
Lambda: A Simple Lambda Library with Proto
Background and Resources
Glossary
Reference
Concepts
Classes
Functions
Header <boost/proto/args.hpp>
Header <boost/proto/core.hpp>
Header <boost/proto/debug.hpp>
Header <boost/proto/deep_copy.hpp>
Header <boost/proto/domain.hpp>
Header <boost/proto/eval.hpp>
Header <boost/proto/expr.hpp>
Header <boost/proto/extends.hpp>
Header <boost/proto/fusion.hpp>
Header <boost/proto/generate.hpp>
Header <boost/proto/literal.hpp>
Header <boost/proto/make_expr.hpp>
Header <boost/proto/matches.hpp>
Header <boost/proto/operators.hpp>
Header <boost/proto/proto.hpp>
Header <boost/proto/proto_fwd.hpp>
Header <boost/proto/proto_typeof.hpp>
Header <boost/proto/repeat.hpp>
Header <boost/proto/tags.hpp>
Header <boost/proto/traits.hpp>
Header <boost/proto/transform/arg.hpp>
Header <boost/proto/transform/call.hpp>
Header <boost/proto/transform/default.hpp>
Header <boost/proto/transform/fold.hpp>
Header <boost/proto/transform/fold_tree.hpp>
Header <boost/proto/transform/impl.hpp>
Header <boost/proto/transform/lazy.hpp>
Header <boost/proto/transform/make.hpp>
Header <boost/proto/transform/pass_through.hpp>
Header <boost/proto/transform/when.hpp>
Header <boost/proto/context/callable.hpp>
Header <boost/proto/context/default.hpp>
Header <boost/proto/context/null.hpp>
Appendices
Appendix A: History
Appendix B: Rationale
Static Initialization
Why Not Reuse MPL, Fusion, et cetera?
Appendix C: Implementation Notes
Quick-n-Dirty Type Categorization
Detecting the Arity of Function Objects
Appendix D: Acknowledgements

Last revised: March 03, 2009 at 22:57:21 GMT


Next