4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
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 type_traits.test unit tests */
26 //#include "type_traits.test.hh"
27 //#include "type_traits.test.ih"
30 #include <boost/static_assert.hpp>
31 #include <boost/type_traits/is_same.hpp>
32 #include "type_traits.hh"
34 #include "../Utils/auto_unit_test.hh"
35 #include <boost/test/test_tools.hpp>
38 ///////////////////////////////cc.p////////////////////////////////////////
44 BOOST_AUTO_UNIT_TEST(typeTraits)
46 typedef boost::function_traits<void (int, double)> traits;
48 BOOST_STATIC_ASSERT(( boost::is_same<
49 senf::function_traits_remove_arg< traits >::type,
50 boost::function_traits<void (double)>
53 BOOST_STATIC_ASSERT(( boost::is_same<
54 senf::function_traits_arg_type< traits, 0 >::type,
57 BOOST_STATIC_ASSERT(( boost::is_same<
58 senf::function_traits_arg_type< traits, 2 >::type,
62 BOOST_STATIC_ASSERT(( boost::is_same<
63 senf::remove_member_pointer< int (Class::*) >::type,
66 BOOST_STATIC_ASSERT(( boost::is_same<
67 senf::remove_member_pointer< void (Class::*)(int) >::type,
71 BOOST_STATIC_ASSERT(( boost::is_same<
72 senf::member_class< int (Class::*) >::type,
75 BOOST_STATIC_ASSERT(( boost::is_same<
76 senf::member_class< int * >::type,
80 BOOST_STATIC_ASSERT(( boost::is_same<
81 senf::remove_any_pointer< int (Class::*) >::type,
84 BOOST_STATIC_ASSERT(( boost::is_same<
85 senf::remove_any_pointer< void (Class::*)(int) >::type,
88 BOOST_STATIC_ASSERT(( boost::is_same<
89 senf::remove_any_pointer < int (*)() >::type,
92 BOOST_STATIC_ASSERT(( boost::is_same<
93 senf::remove_any_pointer < int >::type,
97 BOOST_STATIC_ASSERT(( senf::is_any_function< void () >::value ));
98 BOOST_STATIC_ASSERT(( senf::is_any_function< void (*)(int) >::value ));
99 BOOST_STATIC_ASSERT(( senf::is_any_function< void (Class::*)() >::value ));
100 BOOST_STATIC_ASSERT(( ! senf::is_any_function< int * >::value ));
102 BOOST_STATIC_ASSERT(( boost::is_same<
103 senf::remove_cvref<int const &>::type,
108 ///////////////////////////////cc.e////////////////////////////////////////
115 // comment-column: 40
116 // c-file-style: "senf"
117 // indent-tabs-mode: nil
118 // ispell-local-dictionary: "american"
119 // compile-command: "scons -u test"