1 // Copyright Daniel Wallin 2006. Use, modification and distribution is
2 // subject to the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 #include <boost/parameter.hpp>
6 #include <boost/mpl/assert.hpp>
7 #include <boost/type_traits/is_same.hpp>
10 struct count_instances
17 count_instances(count_instances const&)
23 count_instances(T const&)
33 static std::size_t count;
36 std::size_t count_instances::count = 0;
38 BOOST_PARAMETER_NAME(x)
39 BOOST_PARAMETER_NAME(y)
41 BOOST_PARAMETER_FUNCTION((int), f, tag,
48 BOOST_MPL_ASSERT((boost::is_same<x_type,int>));
49 BOOST_MPL_ASSERT((boost::is_same<y_type,int>));
53 BOOST_PARAMETER_FUNCTION((int), g, tag,
55 (x, (count_instances))
59 BOOST_MPL_ASSERT((boost::is_same<x_type,count_instances>));
60 assert(count_instances::count > 0);
64 BOOST_PARAMETER_FUNCTION((int), h, tag,
66 (x, (count_instances const&))
70 BOOST_MPL_ASSERT((boost::is_same<x_type,count_instances const>));
71 assert(count_instances::count == 1);