STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
hash_map File Reference
#include "backward_warning.h"
#include <bits/c++config.h>
#include <backward/hashtable.h>
#include <bits/concept_check.h>

Macros

#define _BACKWARD_HASH_MAP   1
 

Functions

namespace __gnu_cxx _GLIBCXX_VISIBILITY (default)
 
namespace std _GLIBCXX_VISIBILITY (default)
 

Macro Definition Documentation

#define _BACKWARD_HASH_MAP   1

Function Documentation

namespace std _GLIBCXX_VISIBILITY ( default  )
505 {
506 _GLIBCXX_BEGIN_NAMESPACE_VERSION
507 
508  // Specialization of insert_iterator so that it will work for hash_map
509  // and hash_multimap.
510  template<class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
511  class insert_iterator<__gnu_cxx::hash_map<_Key, _Tp, _HashFn,
512  _EqKey, _Alloc> >
513  {
514  protected:
515  typedef __gnu_cxx::hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>
516  _Container;
517  _Container* container;
518 
519  public:
520  typedef _Container container_type;
521  typedef output_iterator_tag iterator_category;
522  typedef void value_type;
523  typedef void difference_type;
524  typedef void pointer;
525  typedef void reference;
526 
527  insert_iterator(_Container& __x)
528  : container(&__x) {}
529 
530  insert_iterator(_Container& __x, typename _Container::iterator)
531  : container(&__x) {}
532 
533  insert_iterator<_Container>&
534  operator=(const typename _Container::value_type& __value)
535  {
536  container->insert(__value);
537  return *this;
538  }
539 
540  insert_iterator<_Container>&
541  operator*()
542  { return *this; }
543 
544  insert_iterator<_Container>&
545  operator++() { return *this; }
546 
547  insert_iterator<_Container>&
548  operator++(int)
549  { return *this; }
550  };
551 
552  template<class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
553  class insert_iterator<__gnu_cxx::hash_multimap<_Key, _Tp, _HashFn,
554  _EqKey, _Alloc> >
555  {
556  protected:
557  typedef __gnu_cxx::hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc>
558  _Container;
559  _Container* container;
560  typename _Container::iterator iter;
561 
562  public:
563  typedef _Container container_type;
564  typedef output_iterator_tag iterator_category;
565  typedef void value_type;
566  typedef void difference_type;
567  typedef void pointer;
568  typedef void reference;
569 
570  insert_iterator(_Container& __x)
571  : container(&__x) {}
572 
573  insert_iterator(_Container& __x, typename _Container::iterator)
574  : container(&__x) {}
575 
576  insert_iterator<_Container>&
577  operator=(const typename _Container::value_type& __value)
578  {
579  container->insert(__value);
580  return *this;
581  }
582 
583  insert_iterator<_Container>&
584  operator*()
585  { return *this; }
586 
587  insert_iterator<_Container>&
588  operator++()
589  { return *this; }
590 
591  insert_iterator<_Container>&
592  operator++(int)
593  { return *this; }
594  };
595 
596 _GLIBCXX_END_NAMESPACE_VERSION
597 } // namespace