Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
Proto's Built-In Contexts
default_context
null_context
callable_context<>

Proto provides some ready-made context classes that you can use as-is, or that you can use to help while implementing your own contexts. They are:

default_context

An evaluation context that assigns the usual C++ meanings to all the operators. For example, addition nodes are handled by evaluating the left and right children and then adding the results. The proto::default_context uses Boost.Typeof to deduce the types of the expressions it evaluates.

null_context

A simple context that recursively evaluates children but does not combine the results in any way and returns void.

callable_context<>

A helper that simplifies the job of writing context classes. Rather than writing template specializations, with proto::callable_context<> you write a function object with an overloaded function call operator. Any expressions not handled by an overload are automatically dispatched to a default evaluation context that you can specify.


PrevUpHomeNext