⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 config.hpp

📁 C++的一个好库。。。现在很流行
💻 HPP
📖 第 1 页 / 共 2 页
字号:
///////////////////////////////////////////////////////////////////////////////
//
//  T::tag wrapper
//
///////////////////////////////////////////////////////////////////////////////
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
FUSION_MSVC_ETI_WRAPPER(tag)
# define FUSION_GET_TAG(T) ::boost::fusion::detail::get_tag<T>::type
#else
# define FUSION_GET_TAG(T) typename T::tag
#endif

///////////////////////////////////////////////////////////////////////////////
//
//  T::type wrapper
//
///////////////////////////////////////////////////////////////////////////////
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
FUSION_MSVC_ETI_WRAPPER(type)
# define FUSION_GET_TYPE(T) ::boost::fusion::detail::get_type<T>::type
#else
# define FUSION_GET_TYPE(T) typename T::type
#endif

///////////////////////////////////////////////////////////////////////////////
//
//  T::types wrapper
//
///////////////////////////////////////////////////////////////////////////////
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
FUSION_MSVC_ETI_WRAPPER(types)
# define FUSION_GET_TYPES(T) ::boost::fusion::detail::get_types<T>::type
#else
# define FUSION_GET_TYPES(T) typename T::types
#endif

///////////////////////////////////////////////////////////////////////////////
//
//  T::index wrapper
//
///////////////////////////////////////////////////////////////////////////////
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
FUSION_MSVC_ETI_WRAPPER(index)
# define FUSION_GET_INDEX(T) ::boost::fusion::detail::get_index<T>::type
#else
# define FUSION_GET_INDEX(T) typename T::index
#endif

///////////////////////////////////////////////////////////////////////////////
//
//  T::tuple wrapper
//
///////////////////////////////////////////////////////////////////////////////
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
FUSION_MSVC_ETI_WRAPPER(tuple)
# define FUSION_GET_TUPLE(T) ::boost::fusion::detail::get_tuple<T>::type
#else
# define FUSION_GET_TUPLE(T) typename T::tuple
#endif

///////////////////////////////////////////////////////////////////////////////
//
//  T::size wrapper
//
///////////////////////////////////////////////////////////////////////////////
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
FUSION_MSVC_ETI_WRAPPER(size)
# define FUSION_GET_SIZE(T) ::boost::fusion::detail::get_size<T>::type
#else
# define FUSION_GET_SIZE(T) typename T::size
#endif

///////////////////////////////////////////////////////////////////////////////
//
//  T::value_type wrapper
//
///////////////////////////////////////////////////////////////////////////////
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
FUSION_MSVC_ETI_WRAPPER(value_type)
# define FUSION_GET_VALUE_TYPE(T) ::boost::fusion::detail::get_value_type<T>::type
#else
# define FUSION_GET_VALUE_TYPE(T) typename T::value_type
#endif

#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)

namespace boost {namespace fusion { namespace aux {
template< typename T >
struct msvc_never_true
{
    enum { value = false };
};
}}} //namespace boost::fusion::aux

#endif

namespace boost {namespace fusion { 
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)

namespace aux {
    // msvc_apply
#define AUX778076_MSVC_DTW_NAME msvc_apply1
#define AUX778076_MSVC_DTW_ORIGINAL_NAME apply
#define AUX778076_MSVC_DTW_ARITY 1
#include "boost/mpl/aux_/msvc_dtw.hpp"

#define AUX778076_MSVC_DTW_NAME msvc_apply2
#define AUX778076_MSVC_DTW_ORIGINAL_NAME apply
#define AUX778076_MSVC_DTW_ARITY 2
#include "boost/mpl/aux_/msvc_dtw.hpp"

} //namespace aux

template<typename A,typename B>
struct fusion_apply1
{
    typedef typename aux::msvc_apply1<A>::template result_<B>::type type;
};

template<typename A,typename B,typename C>
struct fusion_apply2
{
    typedef typename aux::msvc_apply2<A>::template result_<B,C>::type type;
};

#else 
template<typename A,typename B>
struct fusion_apply1
{
    typedef typename A::template apply<B>::type type;
};
template<typename A,typename B,typename C>
struct fusion_apply2
{
    typedef typename A::template apply<B,C>::type type;
};
#endif
}} //namespace boost::fusion

namespace boost {namespace fusion {namespace detail {
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
    template<typename T>
    struct bool_base {};
    template<>
    struct bool_base<mpl::bool_<true> > : boost::mpl::bool_<true>{};
    template<>
    struct bool_base<mpl::bool_<false> > : boost::mpl::bool_<false>{};
#else
    template<typename T>
    struct bool_base : T {};
#endif
}}}

//VC 6 has serious problems with mpl::int_ in tuple_iterator_base. 
//It ICEs because operator int() const on mpl::int_ is inlined. 
//At the same time, another test using integral_c<T,N> ICEs because operator int() is not inlined. 
//Only solution seems to be to define a special msvc_fusion_int for VC 6 to be used in tuple_iterator_base
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
namespace boost {namespace fusion {namespace detail{

template<int N>
struct msvc_fusion_int
{
    BOOST_STATIC_CONSTANT(int, value = N);
    typedef msvc_fusion_int<N> type;
    typedef int value_type;
    typedef boost::mpl::integral_c_tag tag;

    typedef msvc_fusion_int<value + 1> next;
    typedef msvc_fusion_int<value - 1> prior;

    operator int() const;
};

template<int N>
msvc_fusion_int<N>::operator int() const
{
    return static_cast<int>(this->value); 
}

}}}
#define FUSION_INT(N) boost::fusion::detail::msvc_fusion_int<N>
#else
#define FUSION_INT(N) boost::mpl::int_<N>
#endif



///////////////////////////////////////////////////////////////////////////////
//
//   Borland is so flaky with const correctness of iterators. It's getting
//   confused with tuple_iterator<N, T> where T is a const tuple. We cast
//   what Borland thinks is a const reference to a true reference.
//
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace fusion { namespace detail
{
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551)

    template <typename T>
    T& ref(T const& r)
    {
        return const_cast<T&>(r);
    }

#else

    template <typename T>
    T& ref(T& r)
    {
        return r;
    }

#endif

}}}

#endif


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -