Back to Arangodb

quote

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/quote.html

3.12.9.13.2 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Metafunctions / Composition and Argument Binding / quote |

quote

Synopsis

template<
      template< typename P1 > class F
    , typename Tag =_unspecified_>
struct quote1
{
    //_unspecified_//_..._};_..._template<
      template< typename P1,_..._typename P_n_> class F
    , typename Tag =_unspecified_>
struct[quote](./quote.html)_n_{
    //_unspecified_//_..._};

Description

quoten is a higher-order primitive that wraps an n-ary Metafunction to create a corresponding Metafunction Class.

#include <[boost/mpl/quote.hpp](../../../../boost/mpl/quote.hpp)>

Model of

Metafunction Class

Parameters

ParameterRequirementDescription
FMetafunctionA metafunction to wrap.
TagAny typeA tag determining wrap semantics.

Expression semantics

For any n-ary Metafunction f and arbitrary type tag:

typedef[quote](./quote.html)_n_<f> g;
typedef[quote](./quote.html)_n_<f,tag> g;

| Return type: |

Metafunction Class

| | Semantics: |

Equivalent to

struct g
{
    template< typename A1,_..._typename A_n_> struct[apply](./apply.html): f<A1,_..._A_n_>
    {
    };
};

if f<A1,...An> has a nested type member ::type, and to

struct g
{
    template< typename A1,_..._typename A_n_> struct[apply](./apply.html){
        typedef f<A1,_..._A_n_> type;
    };
};

otherwise.

|

Example

template< typename T > struct f1
{
    typedef T type;
};

template<
    typename T1, typename T2, typename T3, typename T4, typename T5
    >
struct f5
{
    // no 'type' member!
};

typedef[quote](./quote.html)1<f1>::[apply](./apply.html)<int>::type t1;
typedef[quote](./quote.html)5<f5>::[apply](./apply.html)<char,short,int,long,float>::type t5;[BOOST\_MPL\_ASSERT](./assert.html)(( is_same< t1, int > ));[BOOST\_MPL\_ASSERT](./assert.html)(( is_same< t5, f5<char,short,int,long,float> > ));

See also

Composition and Argument Binding, invocation, bind, lambda, protect, apply

| Prev Next | Back Along | Up Home | Full TOC |

Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams 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) |