4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief mpl.test unit tests */
26 //#include "mpl.test.hh"
27 //#include "mpl.test.ih"
32 #include <boost/test/auto_unit_test.hpp>
33 #include <boost/test/test_tools.hpp>
36 ///////////////////////////////cc.p////////////////////////////////////////
42 static bool const has_int_value = false;
43 static bool const has_class_value = false;
46 senf::mpl::rv<0> select_(...);
51 static bool const has_int_value = true;
52 static bool const has_class_value = false;
55 senf::mpl::rv<1> select_(int, senf::mpl::take_int<T::value> * = 0);
59 static bool const has_int_value = false;
60 static bool const has_class_value = true;
63 senf::mpl::rv<2> select_(int, senf::mpl::take_class<typename T::value> * = 0);
66 struct choice : public select<SENF_MPL_RV( select_<T>(0) )> {};
68 struct A { static const int value = 0; };
69 struct B { struct value {}; };
73 BOOST_AUTO_UNIT_TEST(senfmpl)
75 BOOST_CHECK( choice<A>::has_int_value );
76 BOOST_CHECK( ! choice<A>::has_class_value );
78 BOOST_CHECK( ! choice<B>::has_int_value );
79 BOOST_CHECK( choice<B>::has_class_value );
81 BOOST_CHECK( ! choice<C>::has_int_value );
82 BOOST_CHECK( ! choice<C>::has_class_value );
85 ///////////////////////////////cc.e////////////////////////////////////////
93 // c-file-style: "senf"
94 // indent-tabs-mode: nil
95 // ispell-local-dictionary: "american"
96 // compile-command: "scons -u test"