mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-16 05:42:20 +02:00
adds const correctness
[SVN r38200]
This commit is contained in:
@ -25,8 +25,8 @@ struct test_func
|
||||
template<typename T>
|
||||
struct result;
|
||||
|
||||
template<typename B, typename T0, typename T1>
|
||||
struct result<test_func<B>(T0, T1)>
|
||||
template<class Self, typename T0, typename T1>
|
||||
struct result< Self(T0, T1) >
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
|
@ -41,23 +41,23 @@ struct object_nc : boost::noncopyable {};
|
||||
struct fobj
|
||||
{
|
||||
// Handle nullary separately to exercise result_of support
|
||||
template<typename T>
|
||||
template <typename Sig>
|
||||
struct result;
|
||||
|
||||
template<typename T0>
|
||||
struct result<fobj(T0)>
|
||||
template <class Self, typename T0>
|
||||
struct result< Self(T0) >
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
|
||||
template<typename T0, typename T1>
|
||||
struct result<fobj(T0, T1)>
|
||||
template <class Self, typename T0, typename T1>
|
||||
struct result< Self(T0, T1) >
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
|
||||
template<typename T0, typename T1, typename T2>
|
||||
struct result<fobj(T0, T1, T2)>
|
||||
template <class Self, typename T0, typename T1, typename T2>
|
||||
struct result< Self(T0, T1, T2) >
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
@ -92,8 +92,8 @@ struct fobj_nc
|
||||
template <typename T>
|
||||
struct result;
|
||||
|
||||
template<typename T0>
|
||||
struct result<fobj_nc(T0)>
|
||||
template <class Self, typename T0>
|
||||
struct result< Self(T0) >
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
|
@ -10,8 +10,6 @@
|
||||
#include <boost/fusion/functional/invocation/invoke_procedure.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
#include <boost/fusion/functional/adapter/detail/has_type.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
@ -249,35 +247,8 @@ void test_sequence(Sequence & seq)
|
||||
test_sequence_n(seq, mpl::int_<fusion::result_of::size<Sequence>::value>());
|
||||
}
|
||||
|
||||
|
||||
void result_type_tests()
|
||||
{
|
||||
using boost::fusion::detail::has_type;
|
||||
|
||||
BOOST_TEST(( has_type<
|
||||
fusion::result_of::invoke_procedure<int (*)(), fusion::vector0 >
|
||||
>::value ));
|
||||
BOOST_TEST(( has_type<
|
||||
fusion::result_of::invoke_procedure<int (*)(...), fusion::vector1<int> >
|
||||
>::value ));
|
||||
BOOST_TEST(( ! has_type<
|
||||
fusion::result_of::invoke_procedure<int (*)(), fusion::vector1<int> >
|
||||
>::value ));
|
||||
BOOST_TEST(( has_type<
|
||||
fusion::result_of::invoke_procedure<int (members::*)(), fusion::vector1<members*> >
|
||||
>::value ));
|
||||
BOOST_TEST(( has_type<
|
||||
fusion::result_of::invoke_procedure<int (members::*)(...), fusion::vector2<members*,int> >
|
||||
>::value ));
|
||||
BOOST_TEST(( ! has_type<
|
||||
fusion::result_of::invoke_procedure<int (members::*)(), fusion::vector2<members*,int> >
|
||||
>::value ));
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
result_type_tests();
|
||||
|
||||
typedef fusion::vector<> vector0;
|
||||
typedef fusion::vector<element1_type &> vector1;
|
||||
typedef fusion::vector<element1_type &, element2_type> vector2;
|
||||
|
@ -30,8 +30,8 @@ struct test_func
|
||||
};
|
||||
|
||||
|
||||
template<typename B, typename T0, typename T1>
|
||||
struct result<test_func<B>(T0, T1)>
|
||||
template<class Self, typename T0, typename T1>
|
||||
struct result< Self(T0, T1) >
|
||||
{
|
||||
typedef int type;
|
||||
};
|
||||
|
Reference in New Issue
Block a user