## Class string_list

hamigaki::bjam::string_list —

CopyOnWrite方式に基づく文字列リストクラス。

## Synopsis

    class string_list {
    public:
      // types
      typedef std::string&                reference;
      typedef const std::string&          const_reference;
      typedef implementation defined      iterator;
      typedef implementation defined      const_iterator;
      typedef implementation defined      size_type;
      typedef implementation defined      difference_type;
      typedef std::string                 value_type;
      typedef std::allocator<std::string> allocator_type;
      typedef std::string*                pointer;
      typedef const std::string*          const_pointer;
      typedef implementation defined      reverse_iterator;
      typedef implementation defined      const_reverse_iterator;

      // construct/copy/destruct
      string_list();
      explicit string_list(const std::string&);
      template<typename InputIterator> string_list(Iterator, Iterator);

      // iterators
      iterator begin();
      const_iterator begin() const;
      iterator end();
      const_iterator end() const;
      reverse_iterator rbegin();
      const_reverse_iterator rbegin() const;
      reverse_iterator rend();
      const_reverse_iterator rend() const;

      // capacity
      size_type size() const;
      bool empty() const;

      // element access
      const std::string& operator[](size_type) const;

      // modifiers
      void push_back(const std::string&);
      template<typename InputIterator> void insert(iterator, Iterator, Iterator);
      void swap(string_list&);
      void clear();

      // additional member functions
      int compare(const string_list&) const;
       operator safe_bool() const;
      bool operator!() const;
      bool operator<(const string_list&) const;
      bool operator==(const string_list&) const;
      string_list& operator+=(const std::string&);
      string_list& operator+=(const string_list&);
      boost::optional<std::string> try_front() const;
      void sort();
      void unique();
    };

## Description

### `string_list` construct/copy/destruct

1.     string_list();

2.     explicit string_list(const std::string& s);

3.     template<typename InputIterator> string_list(Iterator first, Iterator last);

### `string_list` iterators

1.     iterator begin();
       const_iterator begin() const;

2.     iterator end();
       const_iterator end() const;

3.     reverse_iterator rbegin();
       const_reverse_iterator rbegin() const;

4.     reverse_iterator rend();
       const_reverse_iterator rend() const;

### `string_list` capacity

1.     size_type size() const;

2.     bool empty() const;

### `string_list` element access

1.     const std::string& operator[](size_type n) const;

### `string_list` modifiers

1.     void push_back(const std::string& s);

2.     template<typename InputIterator>
         void insert(iterator position, Iterator first, Iterator last);

3.     void swap(string_list& rhs);

4.     void clear();

### `string_list` additional member functions

1.     int compare(const string_list& rhs) const;

2.      operator safe_bool() const;

3.     bool operator!() const;

4.     bool operator<(const string_list& rhs) const;

5.     bool operator==(const string_list& rhs) const;

6.     string_list& operator+=(const std::string& rhs);

7.     string_list& operator+=(const string_list& rhs);

8.     boost::optional<std::string> try_front() const;

9.     void sort();

10.     void unique();

| 製作著作 © 2007 Takeshi Mouri