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

Macros

#define _BACKWARD_HASH_SET   1
 

Functions

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

Detailed Description

This file is a GNU extension to the Standard C++ Library (possibly containing extensions from the HP/SGI STL subset).

Macro Definition Documentation

#define _BACKWARD_HASH_SET   1

Function Documentation

namespace std _GLIBCXX_VISIBILITY ( default  )
473 {
474 _GLIBCXX_BEGIN_NAMESPACE_VERSION
475 
476  // Specialization of insert_iterator so that it will work for hash_set
477  // and hash_multiset.
478  template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
479  class insert_iterator<__gnu_cxx::hash_set<_Value, _HashFcn,
480  _EqualKey, _Alloc> >
481  {
482  protected:
483  typedef __gnu_cxx::hash_set<_Value, _HashFcn, _EqualKey, _Alloc>
484  _Container;
485  _Container* container;
486 
487  public:
488  typedef _Container container_type;
489  typedef output_iterator_tag iterator_category;
490  typedef void value_type;
491  typedef void difference_type;
492  typedef void pointer;
493  typedef void reference;
494 
495  insert_iterator(_Container& __x)
496  : container(&__x) {}
497 
498  insert_iterator(_Container& __x, typename _Container::iterator)
499  : container(&__x) {}
500 
501  insert_iterator<_Container>&
502  operator=(const typename _Container::value_type& __value)
503  {
504  container->insert(__value);
505  return *this;
506  }
507 
508  insert_iterator<_Container>&
509  operator*()
510  { return *this; }
511 
512  insert_iterator<_Container>&
513  operator++()
514  { return *this; }
515 
516  insert_iterator<_Container>&
517  operator++(int)
518  { return *this; }
519  };
520 
521  template<class _Value, class _HashFcn, class _EqualKey, class _Alloc>
522  class insert_iterator<__gnu_cxx::hash_multiset<_Value, _HashFcn,
523  _EqualKey, _Alloc> >
524  {
525  protected:
526  typedef __gnu_cxx::hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>
527  _Container;
528  _Container* container;
529  typename _Container::iterator iter;
530 
531  public:
532  typedef _Container container_type;
533  typedef output_iterator_tag iterator_category;
534  typedef void value_type;
535  typedef void difference_type;
536  typedef void pointer;
537  typedef void reference;
538 
539  insert_iterator(_Container& __x)
540  : container(&__x) {}
541 
542  insert_iterator(_Container& __x, typename _Container::iterator)
543  : container(&__x) {}
544 
545  insert_iterator<_Container>&
546  operator=(const typename _Container::value_type& __value)
547  {
548  container->insert(__value);
549  return *this;
550  }
551 
552  insert_iterator<_Container>&
553  operator*()
554  { return *this; }
555 
556  insert_iterator<_Container>&
557  operator++()
558  { return *this; }
559 
560  insert_iterator<_Container>&
561  operator++(int) { return *this; }
562  };
563 
564 _GLIBCXX_END_NAMESPACE_VERSION
565 } // namespace