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
Installing Proto
Hello World
Hello Calculator
Expression Construction: Building Proto Expression Trees
Proto's Operator Overloads
Building Expression Trees
Accessing Children Nodes
Operator Tags and Meta-Functions
Expression Construction Utilities
Expression Evaluation: Imparting Behaviors Within A Context
Evaluating An Expression with proto::eval()
Defining an Evaluation Context
Canned Contexts
default_context
null_context
callable_context<>
Expression Introspection: Defining a Grammar
Finding Patterns In Expressions
Fuzzy and Exact Matches of Terminals
if_<>, and_<>, and not_<>
Matching Vararg Expressions
Defining DSEL Grammars
Expression Transformation
Example: Calculator Arity Transform
Canned Transforms
_arg, _left, and _right
_expr, _state and _visitor
if_<>
and_<>, or_<>, and not_<>
call<>
make<>
bind<>
when<>
fold<> and reverse_fold<>
fold_tree<> and reverse_fold_tree<>
pass_through<>
User-Defined Transforms
Making Your Transform Callable
Expression Extension: Giving Expressions Extra Smarts
Domains
The extends<> Expression Wrapper
Expression Generators
Controlling Operator Overloads
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
Reference
Concepts
Header <boost/proto/args.hpp>
Header <boost/proto/context.hpp>
Header <boost/proto/context/callable.hpp>
Header <boost/proto/context/default.hpp>
Header <boost/proto/context/null.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/ref.hpp>
Header <boost/proto/tags.hpp>
Header <boost/proto/traits.hpp>
Header <boost/proto/transform.hpp>
Header <boost/proto/transform/arg.hpp>
Header <boost/proto/transform/bind.hpp>
Header <boost/proto/transform/call.hpp>
Header <boost/proto/transform/fold.hpp>
Header <boost/proto/transform/fold_tree.hpp>
Header <boost/proto/transform/make.hpp>
Header <boost/proto/transform/pass_through.hpp>
Header <boost/proto/transform/when.hpp>
Appendices
Appendix A: History
Appendix B: Rationale
Static Initialization
Proto Transforms and the Restricted ResultOf Protocol
Why Not Reuse MPL, Fusion, et cetera?
Appendix C: Implementation Notes
Quick-n-Dirty Type Categorization
Detecting the Arity of Function Objects
Avoiding Template Instiations With The Preprocessor
Appendix D: Acknowledgements

Last revised: March 13, 2008 at 17:47:24 GMT


Next