30 #ifndef FEELPP_TRAITS_HPP
31 #define FEELPP_TRAITS_HPP 1
35 #include <boost/rational.hpp>
37 #include <boost/mpl/vector.hpp>
38 #include <boost/mpl/max_element.hpp>
39 #include <boost/mpl/transform_view.hpp>
40 #include <boost/mpl/sizeof.hpp>
42 #include <feel/feelcore/feel.hpp>
45 #include <feel/feelcore/ublastraits.hpp>
49 template <
typename T1,
typename T2,
typename T3 = mpl::
void_,
typename T4 = mpl::
void_,
typename T5 = mpl::
void_>
50 struct strongest_numeric_type
52 typedef mpl::vector<T1, T2, T3, T4, T5> types;
53 typedef typename mpl::max_element<mpl::transform_view< types,mpl::sizeof_<mpl::_1> > >::type iter;
54 typedef typename mpl::deref<typename iter::base>::type type;
57 template <
typename T1,
typename T2>
58 struct strongest_numeric_type<T1,std::complex<T2> >
60 typedef typename type_traits<T1>::real_type R1;
61 typedef std::complex<typename strongest_numeric_type<R1,T2>::type > type;
63 template <
typename T1,
typename T2>
64 struct strongest_numeric_type<std::complex<T1>,T2 >
66 typedef typename type_traits<T2>::real_type R2;
67 typedef std::complex<typename strongest_numeric_type<T1,R2>::type > type;
69 template <
typename T1,
typename T2>
70 struct strongest_numeric_type<std::complex<T1>,std::complex<T2> >
72 typedef std::complex<typename strongest_numeric_type<T1,T2>::type > type;
83 struct is_shared_ptr<boost::shared_ptr<T> >
89 struct remove_shared_ptr
95 struct remove_shared_ptr<boost::shared_ptr<T> >