Ticket #2487: and_seq.hpp

File and_seq.hpp, 862 bytes (added by vicente.botet@…, 14 years ago)

mlp::and_ of a sequence of nullary logical metafunctions.

Line 
1/* Copyright 2008 Vicente J. Botet Escriba
2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE_1_0.txt or copy at
4 * http://www.boost.org/LICENSE_1_0.txt)
5 *
6 * See http://www.boost.org/libs/mpl_ext for library home page.
7 */
8
9#ifndef BOOST_MPLEXT_AND_SEQ_HPP_
10#define BOOST_MPLEXT_AND_SEQ_HPP_
11
12#include <boost/mpl/not.hpp>
13#include <boost/mpl/find_if.hpp>
14#include <boost/mpl/end.hpp>
15#include <boost/type_traits/detail/type_trait_def.hpp>
16
17namespace boost {
18namespace mpl_ext {
19
20/*
21Calculate the mlp::and_ of a sequence of nullary logical metafunctions.
22*/
23template <typename Seq>
24struct and_seq : boost::is_same<typename mpl::find_if<Seq, mpl::not_<mpl::_> >::type,
25 typename mpl::end<Seq>::type>
26 {};
27
28} // mpl_ext
29} // boost
30#endif // BOOST_MPLEXT_AND_SEQ_HPP_