Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::proto::domainns_::domain< Generator, Grammar, Super > Struct Template Reference

For use in defining domain tags to be used with proto::extends<>. More...

#include <proto_fwd.hpp>

Inheritance diagram for boost::proto::domainns_::domain< Generator, Grammar, Super >:
Collaboration diagram for boost::proto::domainns_::domain< Generator, Grammar, Super >:

Classes

struct  as_child
 A unary MonomorphicFunctionObject that turns objects into Proto expression objects in this domain. More...
 
struct  as_child< T, typename T::proto_is_expr_, proto::callable >
 INTERNAL ONLY. More...
 
struct  as_expr
 A unary MonomorphicFunctionObject that turns objects into Proto expression objects in this domain. More...
 
struct  as_expr< T, typename T::proto_is_expr_, proto::callable >
 INTERNAL ONLY. More...
 

Public Types

typedef Generator proto_generator
 
typedef Grammar proto_grammar
 
typedef Super proto_super_domain
 
typedef domain proto_base_domain
 
typedef void proto_is_domain_
 INTERNAL ONLY. More...
 

Detailed Description

template<typename Generator, typename Grammar, typename Super>
struct boost::proto::domainns_::domain< Generator, Grammar, Super >

For use in defining domain tags to be used with proto::extends<>.

A Domain associates an expression type with a Generator, and optionally a Grammar.

The Generator determines how new expressions in the domain are constructed. Typically, a generator wraps all new expressions in a wrapper that imparts domain-specific behaviors to expressions within its domain. (See proto::extends<>.)

The Grammar determines whether a given expression is valid within the domain, and automatically disables any operator overloads which would cause an invalid expression to be created. By default, the Grammar parameter defaults to the wildcard, proto::_, which makes all expressions valid within the domain.

The Super declares the domain currently being defined to be a sub-domain of Super. Expressions in sub-domains can be freely combined with expressions in its super- domain (and its super-domain, etc.).

Example:

template<typename Expr>
struct MyExpr;
struct MyGrammar
: or_< terminal<_>, plus<MyGrammar, MyGrammar> >
{};
// Define MyDomain, in which all expressions are
// wrapped in MyExpr<> and only expressions that
// conform to MyGrammar are allowed.
struct MyDomain
: domain<generator<MyExpr>, MyGrammar>
{};
// Use MyDomain to define MyExpr
template<typename Expr>
struct MyExpr
: extends<Expr, MyExpr<Expr>, MyDomain>
{
// ...
};

Member Typedef Documentation

template<typename Generator, typename Grammar, typename Super>
typedef domain boost::proto::domainns_::domain< Generator, Grammar, Super >::proto_base_domain
template<typename Generator, typename Grammar, typename Super>
typedef Generator boost::proto::domainns_::domain< Generator, Grammar, Super >::proto_generator
template<typename Generator, typename Grammar, typename Super>
typedef Grammar boost::proto::domainns_::domain< Generator, Grammar, Super >::proto_grammar
template<typename Generator, typename Grammar, typename Super>
typedef void boost::proto::domainns_::domain< Generator, Grammar, Super >::proto_is_domain_

INTERNAL ONLY.

template<typename Generator, typename Grammar, typename Super>
typedef Super boost::proto::domainns_::domain< Generator, Grammar, Super >::proto_super_domain

The documentation for this struct was generated from the following file: