/usr/include/boost/detail
NameSizeModeActions
winapi/-0755rm
algorithm.hpp28980644editdlrm
allocator_utilities.hpp47900644editdlrm
atomic_count.hpp6180644editdlrm
basic_pointerbuf.hpp44690644editdlrm
binary_search.hpp62390644editdlrm
bitmask.hpp30330644editdlrm
call_traits.hpp43240644editdlrm
catch_exceptions.hpp56770644editdlrm
compressed_pair.hpp170020644editdlrm
container_fwd.hpp51600644editdlrm
fenv.hpp32060644editdlrm
has_default_constructor.hpp9350644editdlrm
identifier.hpp31780644editdlrm
indirect_traits.hpp44230644editdlrm
interlocked.hpp142580644editdlrm
is_incrementable.hpp30710644editdlrm
is_sorted.hpp14320644editdlrm
is_xxx.hpp12500644editdlrm
iterator.hpp11460644editdlrm
lcast_precision.hpp60890644editdlrm
lightweight_main.hpp12260644editdlrm
lightweight_mutex.hpp6300644editdlrm
lightweight_test.hpp4360644editdlrm
lightweight_test_report.hpp22230644editdlrm
lightweight_thread.hpp8110644editdlrm
named_template_params.hpp61240644editdlrm
no_exceptions_support.hpp5700644editdlrm
numeric_traits.hpp54900644editdlrm
ob_compressed_pair.hpp163990644editdlrm
quick_allocator.hpp6060644editdlrm
reference_content.hpp24430644editdlrm
scoped_enum_emulation.hpp5410644editdlrm
select_type.hpp11300644editdlrm
sp_typeinfo.hpp8570644editdlrm
templated_streams.hpp22420644editdlrm
utf8_codecvt_facet.hpp77450644editdlrm
utf8_codecvt_facet.ipp95780644editdlrm
workaround.hpp3350644editdlrm
Edit: /usr/include/boost/detail/ob_compressed_pair.hpp (16399B)
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. // Use, modification and distribution are subject to 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). // // See http://www.boost.org/libs/utility for most recent version including documentation. // see libs/utility/compressed_pair.hpp // /* Release notes: 20 Jan 2001: Fixed obvious bugs (David Abrahams) 07 Oct 2000: Added better single argument constructor support. 03 Oct 2000: Added VC6 support (JM). 23rd July 2000: Additional comments added. (JM) Jan 2000: Original version: this version crippled for use with crippled compilers - John Maddock Jan 2000. */ #ifndef BOOST_OB_COMPRESSED_PAIR_HPP #define BOOST_OB_COMPRESSED_PAIR_HPP #include #ifndef BOOST_OBJECT_TYPE_TRAITS_HPP #include #endif #ifndef BOOST_SAME_TRAITS_HPP #include #endif #ifndef BOOST_CALL_TRAITS_HPP #include #endif namespace boost { #ifdef BOOST_MSVC6_MEMBER_TEMPLATES // // use member templates to emulate // partial specialisation. Note that due to // problems with overload resolution with VC6 // each of the compressed_pair versions that follow // have one template single-argument constructor // in place of two specific constructors: // template class compressed_pair; namespace detail{ template struct best_conversion_traits { typedef char one; typedef char (&two)[2]; static A a; static one test(T1); static two test(T2); enum { value = sizeof(test(a)) }; }; template struct init_one; template <> struct init_one<1> { template static void init(const A& a, T1* p1, T2*) { *p1 = a; } }; template <> struct init_one<2> { template static void init(const A& a, T1*, T2* p2) { *p2 = a; } }; // T1 != T2, both non-empty template class compressed_pair_0 { private: T1 _first; T2 _second; public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_0() : _first(), _second() {} compressed_pair_0(first_param_type x, second_param_type y) : _first(x), _second(y) {} template explicit compressed_pair_0(const A& val) { init_one::value>::init(val, &_first, &_second); } compressed_pair_0(const ::boost::compressed_pair& x) : _first(x.first()), _second(x.second()) {} #if 0 compressed_pair_0& operator=(const compressed_pair_0& x) { cout << "assigning compressed pair 0" << endl; _first = x._first; _second = x._second; cout << "finished assigning compressed pair 0" << endl; return *this; } #endif first_reference first() { return _first; } first_const_reference first() const { return _first; } second_reference second() { return _second; } second_const_reference second() const { return _second; } void swap(compressed_pair_0& y) { using std::swap; swap(_first, y._first); swap(_second, y._second); } }; // T1 != T2, T2 empty template class compressed_pair_1 : T2 { private: T1 _first; public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_1() : T2(), _first() {} compressed_pair_1(first_param_type x, second_param_type y) : T2(y), _first(x) {} template explicit compressed_pair_1(const A& val) { init_one::value>::init(val, &_first, static_cast(this)); } compressed_pair_1(const ::boost::compressed_pair& x) : T2(x.second()), _first(x.first()) {} first_reference first() { return _first; } first_const_reference first() const { return _first; } second_reference second() { return *this; } second_const_reference second() const { return *this; } void swap(compressed_pair_1& y) { // no need to swap empty base class: using std::swap; swap(_first, y._first); } }; // T1 != T2, T1 empty template class compressed_pair_2 : T1 { private: T2 _second; public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_2() : T1(), _second() {} compressed_pair_2(first_param_type x, second_param_type y) : T1(x), _second(y) {} template explicit compressed_pair_2(const A& val) { init_one::value>::init(val, static_cast(this), &_second); } compressed_pair_2(const ::boost::compressed_pair& x) : T1(x.first()), _second(x.second()) {} #if 0 compressed_pair_2& operator=(const compressed_pair_2& x) { cout << "assigning compressed pair 2" << endl; T1::operator=(x); _second = x._second; cout << "finished assigning compressed pair 2" << endl; return *this; } #endif first_reference first() { return *this; } first_const_reference first() const { return *this; } second_reference second() { return _second; } second_const_reference second() const { return _second; } void swap(compressed_pair_2& y) { // no need to swap empty base class: using std::swap; swap(_second, y._second); } }; // T1 != T2, both empty template class compressed_pair_3 : T1, T2 { public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_3() : T1(), T2() {} compressed_pair_3(first_param_type x, second_param_type y) : T1(x), T2(y) {} template explicit compressed_pair_3(const A& val) { init_one::value>::init(val, static_cast(this), static_cast(this)); } compressed_pair_3(const ::boost::compressed_pair& x) : T1(x.first()), T2(x.second()) {} first_reference first() { return *this; } first_const_reference first() const { return *this; } second_reference second() { return *this; } second_const_reference second() const { return *this; } void swap(compressed_pair_3& y) { // no need to swap empty base classes: } }; // T1 == T2, and empty template class compressed_pair_4 : T1 { public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_4() : T1() {} compressed_pair_4(first_param_type x, second_param_type y) : T1(x), m_second(y) {} // only one single argument constructor since T1 == T2 explicit compressed_pair_4(first_param_type x) : T1(x), m_second(x) {} compressed_pair_4(const ::boost::compressed_pair& x) : T1(x.first()), m_second(x.second()) {} first_reference first() { return *this; } first_const_reference first() const { return *this; } second_reference second() { return m_second; } second_const_reference second() const { return m_second; } void swap(compressed_pair_4& y) { // no need to swap empty base classes: } private: T2 m_second; }; // T1 == T2, not empty template class compressed_pair_5 { private: T1 _first; T2 _second; public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair_5() : _first(), _second() {} compressed_pair_5(first_param_type x, second_param_type y) : _first(x), _second(y) {} // only one single argument constructor since T1 == T2 explicit compressed_pair_5(first_param_type x) : _first(x), _second(x) {} compressed_pair_5(const ::boost::compressed_pair& c) : _first(c.first()), _second(c.second()) {} first_reference first() { return _first; } first_const_reference first() const { return _first; } second_reference second() { return _second; } second_const_reference second() const { return _second; } void swap(compressed_pair_5& y) { using std::swap; swap(_first, y._first); swap(_second, y._second); } }; template struct compressed_pair_chooser { template struct rebind { typedef compressed_pair_0 type; }; }; template <> struct compressed_pair_chooser { template struct rebind { typedef compressed_pair_1 type; }; }; template <> struct compressed_pair_chooser { template struct rebind { typedef compressed_pair_2 type; }; }; template <> struct compressed_pair_chooser { template struct rebind { typedef compressed_pair_3 type; }; }; template <> struct compressed_pair_chooser { template struct rebind { typedef compressed_pair_4 type; }; }; template <> struct compressed_pair_chooser { template struct rebind { typedef compressed_pair_5 type; }; }; template struct compressed_pair_traits { private: typedef compressed_pair_chooser::value, is_empty::value, is_same::value> chooser; typedef typename chooser::template rebind bound_type; public: typedef typename bound_type::type type; }; } // namespace detail template class compressed_pair : public detail::compressed_pair_traits::type { private: typedef typename detail::compressed_pair_traits::type base_type; public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair() : base_type() {} compressed_pair(first_param_type x, second_param_type y) : base_type(x, y) {} template explicit compressed_pair(const A& x) : base_type(x){} first_reference first() { return base_type::first(); } first_const_reference first() const { return base_type::first(); } second_reference second() { return base_type::second(); } second_const_reference second() const { return base_type::second(); } }; template inline void swap(compressed_pair& x, compressed_pair& y) { x.swap(y); } #else // no partial specialisation, no member templates: template class compressed_pair { private: T1 _first; T2 _second; public: typedef T1 first_type; typedef T2 second_type; typedef typename call_traits::param_type first_param_type; typedef typename call_traits::param_type second_param_type; typedef typename call_traits::reference first_reference; typedef typename call_traits::reference second_reference; typedef typename call_traits::const_reference first_const_reference; typedef typename call_traits::const_reference second_const_reference; compressed_pair() : _first(), _second() {} compressed_pair(first_param_type x, second_param_type y) : _first(x), _second(y) {} explicit compressed_pair(first_param_type x) : _first(x), _second() {} // can't define this in case T1 == T2: // explicit compressed_pair(second_param_type y) : _first(), _second(y) {} first_reference first() { return _first; } first_const_reference first() const { return _first; } second_reference second() { return _second; } second_const_reference second() const { return _second; } void swap(compressed_pair& y) { using std::swap; swap(_first, y._first); swap(_second, y._second); } }; template inline void swap(compressed_pair& x, compressed_pair& y) { x.swap(y); } #endif } // boost #endif // BOOST_OB_COMPRESSED_PAIR_HPP