| Home | Libraries | People | FAQ | More

## Function unpack_expr

boost::proto::unpack_expr — Construct an expression of the requested tag type with a domain and with children from the specified Fusion Forward Sequence.

## Synopsis

    // In header: <boost/proto/make_expr.hpp>

    template<typename Tag, typename Sequence>
      typename proto::result_of::unpack_expr<Tag, Sequence const>::type const
      unpack_expr(Sequence const & sequence);
    template<typename Tag, typename Domain, typename Sequence>
      typename proto::result_of::unpack_expr<Tag, Domain, Sequence const>::type const
      unpack_expr(Sequence const & sequence);

## Description

This function template may be invoked either with or without specifying a `Domain` argument. If no domain is specified, the domain is deduced by examining in order the domains of the elements of `sequence` and taking the first that is not ``proto::default_domain``, if any such domain exists, or ``proto::default_domain`` otherwise.

Let `s` be a Fusion Random Access Sequence equivalent to `sequence`. Let ``WRAP`<N>(s)`, where `s` has type `S`, be defined such that:

- If `fusion::result_of::value_at_c<S,N>::type` is a reference, ``WRAP`<N>(s)` is equivalent to ``proto::as_child`<Domain>(fusion::at_c<N>(s))`.

- Otherwise, ``WRAP`<N>(s)` is equivalent to ``proto::as_expr`<Domain>(fusion::at_c<N>(s))`.

Let ``MAKE`<Tag>(a...)` be defined as ``proto::expr`<Tag, `proto::listN`<A...> >::make(a...)` where `Ax` is the type of `ax`.

Parameters: |
`sequence` | A Fusion Forward Sequence.
Returns: | `Domain()(`MAKE`<Tag>(`WRAP`<0>(s),... `WRAP`<`N`-1>(s)))`, where `N` is the size of `Sequence`.