Update of /cvsroot/boost/boost/libs/function_types/test/decomposition
In directory 
sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18022/function_types/test/decomposition

Added Files:
        class_type_transform.cpp components.cpp components_seq.cpp 
        function_arity.cpp function_arity_fail.cpp parameter_types.cpp 
        parameter_types_fail.cpp result_type.cpp result_type_fail.cpp 
Log Message:
libs/function_types/* - check-in


--- NEW FILE: class_type_transform.cpp ---

// (C) Copyright Tobias Schwinger
//
// Use modification and distribution are subject to the boost Software License,
// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).

//------------------------------------------------------------------------------

#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/add_pointer.hpp>

#include <boost/mpl/assert.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/always.hpp>

#include <boost/function_types/components.hpp>
#include <boost/function_types/parameter_types.hpp>

using namespace boost;
namespace ft = function_types;
using boost::mpl::placeholders::_;

class C; 
typedef C (C::*mem_func_ptr)();
class X;

BOOST_MPL_ASSERT((
  is_same< mpl::at_c< 
    ft::components<mem_func_ptr, add_pointer<_> >
  ,1 >::type, C* >
));
BOOST_MPL_ASSERT((
  is_same< mpl::at_c< 
    ft::components<mem_func_ptr, add_pointer< add_pointer<_> > >
  ,1 >::type, C** >
));
BOOST_MPL_ASSERT((
  is_same< mpl::at_c< 
    ft::components<mem_func_ptr, mpl::always<X> >
  ,1 >::type, X >
));

BOOST_MPL_ASSERT((
  is_same< mpl::at_c< 
    ft::parameter_types<mem_func_ptr, add_pointer<_> >
  ,0 >::type, C* >
));
BOOST_MPL_ASSERT((
  is_same< mpl::at_c< 
    ft::parameter_types<mem_func_ptr, add_pointer< add_pointer<_> > >
  ,0 >::type, C** >
));
BOOST_MPL_ASSERT((
  is_same< mpl::at_c< 
    ft::parameter_types<mem_func_ptr, mpl::always<X> >
  ,0 >::type, X >
));





--- NEW FILE: components.cpp ---

// (C) Copyright Tobias Schwinger
//
// Use modification and distribution are subject to the boost Software License,
// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).

//------------------------------------------------------------------------------

#include <boost/mpl/assert.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/equal.hpp>

#include <boost/function_types/components.hpp>

namespace ft = boost::function_types;
namespace mpl = boost::mpl;

class C; 
typedef C func();
typedef C (*func_ptr)(int);
typedef C (&func_ref)(int,int);
typedef C (C::*mem_func_ptr)();
typedef C (C::*c_mem_func_ptr)(int) const;
typedef C (C::*v_mem_func_ptr)(int,int) volatile;
typedef C (C::*cv_mem_func_ptr)(int,int,int) const volatile;
typedef int C::* mem_ptr;

BOOST_MPL_ASSERT((
  mpl::equal< ft::components<func>::types, mpl::vector<C> >
));

BOOST_MPL_ASSERT((
  mpl::equal< ft::components<func_ptr>::types, mpl::vector<C,int> >
));

BOOST_MPL_ASSERT((
  mpl::equal< ft::components<func_ref>::types, mpl::vector<C,int,int> >
));

BOOST_MPL_ASSERT((
  mpl::equal< ft::components<mem_func_ptr>::types, mpl::vector<C,C &> >
));

BOOST_MPL_ASSERT((
  mpl::equal< ft::components<c_mem_func_ptr>::types, mpl::vector<C,C const 
&,int> >
));

BOOST_MPL_ASSERT((
  mpl::equal< ft::components<v_mem_func_ptr>::types, mpl::vector<C,C volatile 
&,int,int> >
));

BOOST_MPL_ASSERT((
  mpl::equal< ft::components<cv_mem_func_ptr>::types, mpl::vector<C,C const 
volatile &,int,int,int> >
));

BOOST_MPL_ASSERT((
  mpl::equal< ft::components<mem_ptr>::types, mpl::vector<int &,C&> >
));


--- NEW FILE: components_seq.cpp ---

// (C) Copyright Tobias Schwinger
//
// Use modification and distribution are subject to the boost Software License,
// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).

//------------------------------------------------------------------------------

#include <boost/type_traits/is_same.hpp>

#include <boost/mpl/assert.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/equal.hpp>

#include <boost/mpl/front.hpp>
#include <boost/mpl/back.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/clear.hpp>
#include <boost/mpl/push_front.hpp>
#include <boost/mpl/pop_front.hpp>
#include <boost/mpl/push_back.hpp>
#include <boost/mpl/pop_back.hpp>
#include <boost/mpl/size.hpp>
#include <boost/mpl/empty.hpp>

#include <boost/function_types/components.hpp>

namespace ft = boost::function_types;
namespace mpl = boost::mpl;
using boost::is_same;

class C;
typedef C (C::* mem_func_ptr)(int);
typedef ft::components<mem_func_ptr> c;


// front
BOOST_MPL_ASSERT(( is_same< ::boost::mpl::front<c>::type, C > ));

// back
BOOST_MPL_ASSERT(( is_same< ::boost::mpl::back<c>::type, int > ));

// at
BOOST_MPL_ASSERT(( is_same< ::boost::mpl::at_c<c,0>::type, C   > ));
BOOST_MPL_ASSERT(( is_same< ::boost::mpl::at_c<c,1>::type, C & > ));
BOOST_MPL_ASSERT(( is_same< ::boost::mpl::at_c<c,2>::type, int > ));

// begin/end
BOOST_MPL_ASSERT(( mpl::equal< c, mpl::vector<C,C &, int> > ));


// clear
BOOST_MPL_ASSERT(( mpl::equal< mpl::clear<c>, mpl::vector<> > ));

// push_front
BOOST_MPL_ASSERT(( mpl::equal< mpl::push_front<c,C>::type, mpl::vector<C,C,C 
&,int> > ));

// pop_front
BOOST_MPL_ASSERT(( mpl::equal< mpl::pop_front<c>::type, mpl::vector<C &,int> > 
));

// push_back
BOOST_MPL_ASSERT(( mpl::equal< mpl::push_back<c,C>::type, mpl::vector<C,C 
&,int,C> > ));

// pop_back
BOOST_MPL_ASSERT(( mpl::equal< mpl::pop_back<c>::type, mpl::vector<C,C &> > ));


// size
BOOST_MPL_ASSERT_RELATION( ::boost::mpl::size<c>::value, ==, 3 );

// empty
BOOST_MPL_ASSERT_NOT(( mpl::empty<c> ));
BOOST_MPL_ASSERT(( mpl::empty< mpl::clear<c> > ));


--- NEW FILE: function_arity.cpp ---

// (C) Copyright Tobias Schwinger
//
// Use modification and distribution are subject to the boost Software License,
// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).

//------------------------------------------------------------------------------

#include <boost/mpl/assert.hpp>

#include <boost/function_types/function_arity.hpp>

class C; 
typedef C func();
typedef C (*func_ptr)(int);
typedef C (&func_ref)(int,int);
typedef C (C::*mem_func_ptr)();
typedef C (C::*c_mem_func_ptr)(int) const;
typedef C (C::*v_mem_func_ptr)(int,int) volatile;
typedef C (C::*cv_mem_func_ptr)(int,int,int) const volatile;
typedef int C::* mem_ptr;

BOOST_MPL_ASSERT_RELATION( 
::boost::function_types::function_arity<func>::value, ==, 0 );
BOOST_MPL_ASSERT_RELATION( 
::boost::function_types::function_arity<func_ptr>::value, ==, 1 );
BOOST_MPL_ASSERT_RELATION( 
::boost::function_types::function_arity<func_ref>::value, ==, 2 );
BOOST_MPL_ASSERT_RELATION( 
::boost::function_types::function_arity<mem_func_ptr>::value, ==, 1 );
BOOST_MPL_ASSERT_RELATION( 
::boost::function_types::function_arity<c_mem_func_ptr>::value, ==, 2 );
BOOST_MPL_ASSERT_RELATION( 
::boost::function_types::function_arity<v_mem_func_ptr>::value, ==, 3 );
BOOST_MPL_ASSERT_RELATION( 
::boost::function_types::function_arity<cv_mem_func_ptr>::value, ==, 4 );
BOOST_MPL_ASSERT_RELATION( 
::boost::function_types::function_arity<mem_ptr>::value, ==, 1 );


--- NEW FILE: function_arity_fail.cpp ---

// (C) Copyright Tobias Schwinger
//
// Use modification and distribution are subject to the boost Software License,
// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).

//------------------------------------------------------------------------------

#include <boost/function_types/function_arity.hpp>


namespace ft = boost::function_types;

class C;

typedef ft::function_arity<C>::type error_1;
typedef ft::function_arity<int>::type error_2;
typedef ft::function_arity<void>::type error_3;


--- NEW FILE: parameter_types.cpp ---

// (C) Copyright Tobias Schwinger
//
// Use modification and distribution are subject to the boost Software License,
// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).

//------------------------------------------------------------------------------

#include <boost/mpl/assert.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/equal.hpp>

#include <boost/function_types/parameter_types.hpp>


namespace ft = boost::function_types;
namespace mpl = boost::mpl;

class C;
typedef C func(C);
typedef C (*func_ptr)(C,int);
typedef C (&func_ref)();
typedef C (C::*mem_func_ptr)(C,int);
typedef C (C::*c_mem_func_ptr)(C,C) const;
typedef C (C::*v_mem_func_ptr)(C) volatile;
typedef C (C::*cv_mem_func_ptr)() const volatile;


BOOST_MPL_ASSERT((
  mpl::equal< ft::parameter_types<func>, mpl::vector<C> >
));

BOOST_MPL_ASSERT((
  mpl::equal< ft::parameter_types<func_ptr>::type, mpl::vector<C,int> >
));

BOOST_MPL_ASSERT((
  mpl::equal< ft::parameter_types<func_ref>, mpl::vector<> >
));

BOOST_MPL_ASSERT((
  mpl::equal< ft::parameter_types<mem_func_ptr>, mpl::vector<C &,C,int> >
));

BOOST_MPL_ASSERT((
  mpl::equal< ft::parameter_types<c_mem_func_ptr>, mpl::vector<C const &,C,C> >
));

BOOST_MPL_ASSERT((
  mpl::equal< ft::parameter_types<v_mem_func_ptr>, mpl::vector<C volatile &,C> >
));

BOOST_MPL_ASSERT((
  mpl::equal< ft::parameter_types<cv_mem_func_ptr>, mpl::vector<C const 
volatile &> >
));


--- NEW FILE: parameter_types_fail.cpp ---

// (C) Copyright Tobias Schwinger
//
// Use modification and distribution are subject to the boost Software License,
// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).

//------------------------------------------------------------------------------

#include <boost/function_types/parameter_types.hpp>


namespace ft = boost::function_types;

class C; 

typedef ft::parameter_types<C>::type error_1;
typedef ft::parameter_types<char>::type error_2;
typedef ft::parameter_types<void>::type error_3;


--- NEW FILE: result_type.cpp ---

// (C) Copyright Tobias Schwinger
//
// Use modification and distribution are subject to the boost Software License,
// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).

//------------------------------------------------------------------------------

#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_same.hpp>

#include <boost/function_types/result_type.hpp>


namespace ft = boost::function_types;

class C; 
typedef C func();
typedef C (*func_ptr)();
typedef C (&func_ref)();
typedef C (C::*mem_func_ptr)();
typedef C (C::*c_mem_func_ptr)() const;
typedef C (C::*v_mem_func_ptr)() volatile;
typedef C (C::*cv_mem_func_ptr)() const volatile;
typedef int C::* mem_ptr;
typedef int const C::* c_mem_ptr;

BOOST_MPL_ASSERT((
  boost::is_same<ft::result_type<func>::type,C>
));

BOOST_MPL_ASSERT((
  boost::is_same<ft::result_type<func_ptr>::type,C>
));

BOOST_MPL_ASSERT((
  boost::is_same<ft::result_type<func_ref>::type,C>
));

BOOST_MPL_ASSERT((
  boost::is_same<ft::result_type<mem_func_ptr>::type,C>
));

BOOST_MPL_ASSERT((
  boost::is_same<ft::result_type<c_mem_func_ptr>::type,C>
));

BOOST_MPL_ASSERT((
  boost::is_same<ft::result_type<v_mem_func_ptr>::type,C>
));

BOOST_MPL_ASSERT((
  boost::is_same<ft::result_type<cv_mem_func_ptr>::type,C>
));

BOOST_MPL_ASSERT((
  boost::is_same<ft::result_type<mem_ptr>::type,int&>
));

BOOST_MPL_ASSERT((
  boost::is_same<ft::result_type<c_mem_ptr>::type,int const&>
));


--- NEW FILE: result_type_fail.cpp ---

// (C) Copyright Tobias Schwinger
//
// Use modification and distribution are subject to the boost Software License,
// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).

//------------------------------------------------------------------------------

#include <boost/function_types/result_type.hpp>


namespace ft = boost::function_types;

class C; 

typedef ft::result_type<C>::type error_1;
typedef ft::result_type<char>::type error_2;
typedef ft::result_type<void>::type error_3;



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to