# and_

### Synopsis

    template<
          typename F1
        , typename F2
        , typename F3 = true_
        ...
        , typename Fn = true_
        >
    struct and_
    {
        typedef unspecified type;
    };

### Description

Returns the result of short-circuit logical and (`&&`) operation on its arguments.

### Definition

    #include "boost/mpl/and.hpp"

### Parameters

Parameter | Requirement | Description
--- | --- | ---
`F1, F2, .., Fn` | A model of nullary Metafunction |

### Expression semantics

Expression | Expression type | Precondition | Semantics | Postcondition
--- | --- | --- | --- | ---
`typedef and_<f1,f2,..,fn>::type c;` | A model of `bool` Integral Constant |  | Returns `false_` if either of `f1::type::value, f2::type::value, .., fn::type::value` expressions evaluates to `false`, and `true_` otherwise; guarantees left-to-right evaluation; moreover, the operands subsequent to the first `fi` metafunction that evaluates to `false` are not evaluated. |

### Example

    // will generate compile-time error if invoked with T == any fundamental type
    template< typename T > struct fail
    {
       typedef typename T::nonexistent type;
    };

    BOOST_STATIC_ASSERT((and_< true_,false_ >::type::value == false));
    BOOST_STATIC_ASSERT((and_< false_,fail<int> >::type::value == false)); // OK, fail<int> is never invoked
    BOOST_STATIC_ASSERT((and_< true_,false_,fail<int> >::type::value == false)); // OK too

### See also

Metafunctions, `or_`, `not_`

Table of Contents
Last edited March 10, 2003 1:21 am