STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
slist File Reference
#include <algorithm>
#include <bits/allocator.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/concept_check.h>

Macros

#define _SLIST   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 _SLIST   1

Function Documentation

namespace std _GLIBCXX_VISIBILITY ( default  )
1029 {
1030 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1031 
1032  // Specialization of insert_iterator so that insertions will be constant
1033  // time rather than linear time.
1034  template <class _Tp, class _Alloc>
1035  class insert_iterator<__gnu_cxx::slist<_Tp, _Alloc> >
1036  {
1037  protected:
1038  typedef __gnu_cxx::slist<_Tp, _Alloc> _Container;
1039  _Container* container;
1040  typename _Container::iterator iter;
1041 
1042  public:
1043  typedef _Container container_type;
1044  typedef output_iterator_tag iterator_category;
1045  typedef void value_type;
1046  typedef void difference_type;
1047  typedef void pointer;
1048  typedef void reference;
1049 
1050  insert_iterator(_Container& __x, typename _Container::iterator __i)
1051  : container(&__x)
1052  {
1053  if (__i == __x.begin())
1054  iter = __x.before_begin();
1055  else
1056  iter = __x.previous(__i);
1057  }
1058 
1059  insert_iterator<_Container>&
1060  operator=(const typename _Container::value_type& __value)
1061  {
1062  iter = container->insert_after(iter, __value);
1063  return *this;
1064  }
1065 
1066  insert_iterator<_Container>&
1067  operator*()
1068  { return *this; }
1069 
1070  insert_iterator<_Container>&
1071  operator++()
1072  { return *this; }
1073 
1074  insert_iterator<_Container>&
1075  operator++(int)
1076  { return *this; }
1077  };
1078 
1079 _GLIBCXX_END_NAMESPACE_VERSION
1080 } // namespace