/*============================================================================= Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2006 Tobias Schwinger Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #if !defined(FUSION_PAIR_07222005_1203) #define FUSION_PAIR_07222005_1203 #include #include #include #include #include #include #include #if defined (BOOST_MSVC) # pragma warning(push) # pragma warning (disable: 4512) // assignment operator could not be generated. #endif namespace boost { namespace fusion { // A half runtime pair where the first type does not have data template struct pair { BOOST_FUSION_GPU_ENABLED pair() : second() {} BOOST_FUSION_GPU_ENABLED pair(pair const& rhs) : second(rhs.second) {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) BOOST_FUSION_GPU_ENABLED pair(pair&& rhs) : second(std::forward(rhs.second)) {} #endif BOOST_FUSION_GPU_ENABLED pair(typename detail::call_param::type val) : second(val) {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template BOOST_FUSION_GPU_ENABLED pair(Second2&& val , typename boost::enable_if >::type* /*dummy*/ = 0 ) : second(std::forward(val)) {} #endif template BOOST_FUSION_GPU_ENABLED pair(pair const& rhs) : second(rhs.second) {} template BOOST_FUSION_GPU_ENABLED pair& operator=(pair const& rhs) { second = rhs.second; return *this; } BOOST_FUSION_GPU_ENABLED pair& operator=(pair const& rhs) { second = rhs.second; return *this; } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) BOOST_FUSION_GPU_ENABLED pair& operator=(pair&& rhs) { second = std::forward(rhs.second); return *this; } #endif typedef First first_type; typedef Second second_type; Second second; }; namespace result_of { template struct make_pair { typedef fusion::pair::type> type; }; template struct first { typedef typename Pair::first_type type; }; template struct second { typedef typename Pair::second_type type; }; } template BOOST_FUSION_GPU_ENABLED inline typename result_of::make_pair::type make_pair(Second const& val) { return pair::type>(val); } template inline std::ostream& operator<<(std::ostream& os, pair const& p) { os << p.second; return os; } template inline std::istream& operator>>(std::istream& is, pair& p) { is >> p.second; return is; } template BOOST_FUSION_GPU_ENABLED inline bool operator==(pair const& l, pair const& r) { return l.second == r.second; } template BOOST_FUSION_GPU_ENABLED inline bool operator!=(pair const& l, pair const& r) { return l.second != r.second; } template BOOST_FUSION_GPU_ENABLED inline bool operator<(pair const& l, pair const& r) { return l.second < r.second; } }} #if defined (BOOST_MSVC) # pragma warning(pop) #endif #endif