From 23730202256b980ed69def105ad7bda65fed2d69 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Tue, 1 Oct 2002 22:48:24 +0000 Subject: [PATCH] doc update [SVN r15639] --- doc/v2/dict.html | 4 +- doc/v2/list.html | 140 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 doc/v2/list.html diff --git a/doc/v2/dict.html b/doc/v2/dict.html index ee38c2bc..0fe58f1b 100644 --- a/doc/v2/dict.html +++ b/doc/v2/dict.html @@ -72,7 +72,7 @@ "ObjectWrapper.html#TypeWrapper-concept">TypeWrapper concept definition. Since dict is publicly derived from object, the public object - interfaceapplies to dict instances as well.

+ interface applies to dict instances as well.

Class dict synopsis

@@ -126,7 +126,7 @@ namespace boost object itervalues() const; list keys() const; }; -}; +}

Example

diff --git a/doc/v2/list.html b/doc/v2/list.html new file mode 100644 index 00000000..843e4519 --- /dev/null +++ b/doc/v2/list.html @@ -0,0 +1,140 @@ + + + + + + + + + Boost.Python - <boost/python/list.hpp> + + + + + + + + + +
+

C++ Boost

+
+

Boost.Python

+ +

Header <boost/python/list.hpp>

+
+
+ +

Contents

+ +
+
Introduction
+ +
Classes
+ +
+
+
Class list
+ +
+
+
Class list + synopsis
+
+
+
+
+ +
Example(s)
+
+
+ +

Introduction

+ +

Exposes a TypeWrapper for the Python + list + type.

+ +

Classes

+ +

Class list

+ +

Exposes the mapping + protocol of Python's built-in list type. The semantics + of the constructors and member functions defined below can be fully + understood by reading the TypeWrapper concept + definition. Since list is publicly derived from object, the public object + interface applies to list instances as well.

+ +

Class list + synopsis

+
+namespace boost
+{
+  class list : public object
+  {
+   public:
+      list(); // new list
+
+      template <class T>
+      explicit list(T const& sequence);
+
+      template <class T>
+      void append(T const& x);
+
+      template <class T>
+      long count(T const& value) const;
+
+      template <class T>
+      void extend(T const& x);
+
+      template <class T>
+      long index(T const& x) const;
+
+      template <class T>
+      void insert(object const& index, T const& x); // insert object before index
+
+      object pop(); // remove and return item at index (default last)
+      object pop(long index);
+      object pop(object const& index);
+
+      template <class T>
+      void remove(T const& value);
+
+      void reverse(); // reverse *IN PLACE*
+
+      void sort(); //  sort *IN PLACE*; if given, cmpfunc(x, y) -> -1, 0, 1
+
+      template <class T>
+      void sort(T const& value);
+  };
+}
+
+ +

Example

+
+using namespace boost::python;
+
+// Return the number of zeroes in the list
+long zeroes(list l)
+{
+   return l.count(0);
+}
+
+ +

Revised 1 October, 2002

+ +

© Copyright Dave Abrahams 2002. All Rights + Reserved.

+ + +