FUNCTION UNPACK_EX(3)

NAME
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 domains of each element of the sequence. See proto::deduce_domain for a full description of the procedure used.

Let s be a Fusion RandomAccessSequence equivalent to sequence. Let WRAP(N, s) be defined such that:

    &#8226; If fusion::result_of::value_at_c<decltype(s),N>::type is a reference type or an instantiation of boost::reference_wrapper<>, WRAP(N, s) is equivalent to proto::as_child<Domain>(fusion::at_c<N>(s)).

    &#8226; Otherwise, WRAP(N, s) is equivalent to proto::as_expr<Domain>(fusion::at_c<N>(s)).

If proto::wants_basic_expr<typename Domain::proto_generator>::value is true, then let E be proto::basic_expr; otherwise, let E be proto::expr.

Let MAKE(Tag, b...) be defined as E<Tag, proto::listN<decltype(b)...> >::make(b...).

If Tag is proto::tag::terminal, then return WRAP(0, s).

Otherwise, return Domain()(MAKE(Tag, WRAP(0, s),... WRAP(N-1, s))), where N is the size of Sequence.

Parameters:

    sequence
        A Fusion Forward Sequence.