Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template compressed_pair

boost::compressed_pair

Synopsis

// In header: <boost/detail/compressed_pair.hpp>

template<typename T1, typename T2> 
class compressed_pair : private boost::details::compressed_pair_imp< T1, T2, ::boost::details::compressed_pair_switch< T1, T2, ::boost::is_same< remove_cv< T1 >::type, remove_cv< T2 >::type >::value, ::boost::details::compressed_pair_empty< T1 >::value, ::boost::details::compressed_pair_empty< T2 >::value >::value >
{
public:
  // types
  typedef T1                                          first_type;            
  typedef T2                                          second_type;           
  typedef call_traits< first_type >::param_type       first_param_type;      
  typedef call_traits< second_type >::param_type      second_param_type;     
  typedef call_traits< first_type >::reference        first_reference;       
  typedef call_traits< second_type >::reference       second_reference;      
  typedef call_traits< first_type >::const_reference  first_const_reference; 
  typedef call_traits< second_type >::const_reference second_const_reference;

  // construct/copy/destruct
  compressed_pair();
  compressed_pair(first_param_type, second_param_type);
  explicit compressed_pair(first_param_type);
  explicit compressed_pair(second_param_type);

  // public member functions
  first_reference first();
  first_const_reference first() const;
  second_reference second();
  second_const_reference second() const;
  void swap(compressed_pair &);
};

Description

compressed_pair public construct/copy/destruct

  1. compressed_pair();
  2. compressed_pair(first_param_type x, second_param_type y);
  3. explicit compressed_pair(first_param_type x);
  4. explicit compressed_pair(second_param_type y);

compressed_pair public member functions

  1. first_reference first();
  2. first_const_reference first() const;
  3. second_reference second();
  4. second_const_reference second() const;
  5. void swap(compressed_pair & y);

PrevUpHomeNext