From 2a199af8f760844ee7a7792edf0dd0eb078a9f0b Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Tue, 1 Oct 2002 23:03:09 +0000 Subject: [PATCH] doc update [SVN r15641] --- doc/v2/long.html | 117 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 doc/v2/long.html diff --git a/doc/v2/long.html b/doc/v2/long.html new file mode 100644 index 00000000..799fa533 --- /dev/null +++ b/doc/v2/long.html @@ -0,0 +1,117 @@ + + + + + + + + + Boost.Python - <boost/python/long.hpp> + + + + + + + + + +
+

C++ Boost

+
+

Boost.Python

+ +

Header <boost/python/long.hpp>

+
+
+ +

Contents

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

Introduction

+ +

Exposes a TypeWrapper for the Python + long + integer type.

+ +

Classes

+ +

Class long_

+ +

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

+ +

Class long_ + synopsis

+
+namespace boost
+{
+  class long_ : public object
+  {
+   public:
+      long_(); // new long_
+
+      template <class T>
+      explicit long_(T const& rhs);
+
+      template <class T, class U>
+      long_(T const& rhs, U const& base);
+  };
+}
+
+ +

Example

+
+namespace python = boost::python;
+
+// compute a factorial without overflowing
+python::long_ fact(long n)
+{
+   if (n == 0)
+      return python::long_(1);
+   else
+      return n * fact(n - 1);
+}
+
+ +

Revised 1 October, 2002

+ +

© Copyright Dave Abrahams 2002. All Rights + Reserved.

+ + +