1// Boost.TypeErasure library
2//
3// Copyright 2012 Steven Watanabe
4//
5// Distributed under the Boost Software License Version 1.0. (See
6// accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
9// $Id$
10
11#include <boost/type_erasure/is_subconcept.hpp>
12#include <boost/type_erasure/builtin.hpp>
13#include <boost/type_erasure/operators.hpp>
14#include <boost/mpl/vector.hpp>
15#include <boost/mpl/assert.hpp>
16
17namespace mpl = boost::mpl;
18using namespace boost::type_erasure;
19
20BOOST_MPL_ASSERT((is_subconcept<typeid_<>, typeid_<> >));
21BOOST_MPL_ASSERT_NOT((is_subconcept<typeid_<>, incrementable<> >));
22BOOST_MPL_ASSERT_NOT((is_subconcept<mpl::vector<typeid_<>, incrementable<> >, typeid_<> >));
23BOOST_MPL_ASSERT_NOT((is_subconcept<mpl::vector<typeid_<>, incrementable<> >, incrementable<> >));
24BOOST_MPL_ASSERT((is_subconcept<typeid_<>, mpl::vector<typeid_<>, incrementable<> > >));
25BOOST_MPL_ASSERT((is_subconcept<incrementable<>, mpl::vector<typeid_<>, incrementable<> > >));
26BOOST_MPL_ASSERT((is_subconcept<mpl::vector<typeid_<>, incrementable<> >, mpl::vector<incrementable<>, typeid_<> > >));
27
28BOOST_MPL_ASSERT((is_subconcept<typeid_<_a>, typeid_<_b>, mpl::map<mpl::pair<_a, _b> > >));
29BOOST_MPL_ASSERT_NOT((is_subconcept<typeid_<_a>, incrementable<_b>, mpl::map<mpl::pair<_a, _b> > >));
30BOOST_MPL_ASSERT_NOT((is_subconcept<mpl::vector<typeid_<_a>, incrementable<_a> >, typeid_<_b>, mpl::map<mpl::pair<_a, _b> > >));
31BOOST_MPL_ASSERT_NOT((is_subconcept<mpl::vector<typeid_<_a>, incrementable<_a> >, incrementable<_b>, mpl::map<mpl::pair<_a, _b> > >));
32BOOST_MPL_ASSERT((is_subconcept<typeid_<_a>, mpl::vector<typeid_<_b>, incrementable<_b> >, mpl::map<mpl::pair<_a, _b> > >));
33BOOST_MPL_ASSERT((is_subconcept<incrementable<_a>, mpl::vector<typeid_<_b>, incrementable<_b> >, mpl::map<mpl::pair<_a, _b> > >));
34BOOST_MPL_ASSERT((is_subconcept<mpl::vector<typeid_<_a>, incrementable<_a> >, mpl::vector<incrementable<_b>, typeid_<_b> >, mpl::map<mpl::pair<_a, _b> > >));
35

source code of boost/libs/type_erasure/test/test_is_subconcept.cpp