[Gmp-commit] /var/hg/gmp: Polish doc of C++ constructors.

mercurial at gmplib.org mercurial at gmplib.org
Wed Mar 9 13:06:05 CET 2011


details:   /var/hg/gmp/rev/331ecfff78c3
changeset: 14015:331ecfff78c3
user:      Marc Glisse <marc.glisse at inria.fr>
date:      Wed Mar 09 12:55:35 2011 +0100
description:
Polish doc of C++ constructors.

diffstat:

 ChangeLog    |   5 +++++
 doc/gmp.texi |  40 +++++++++++++++++++++++-----------------
 2 files changed, 28 insertions(+), 17 deletions(-)

diffs (99 lines):

diff -r 71949bf7c948 -r 331ecfff78c3 ChangeLog
--- a/ChangeLog	Wed Mar 09 00:04:44 2011 +0100
+++ b/ChangeLog	Wed Mar 09 12:55:35 2011 +0100
@@ -1,3 +1,8 @@
+2011-03-09  Marc Glisse  <marc.glisse at inria.fr>
+
+	* doc/gmp.texi: Remove void return type from constructors. Document
+	explicit constructors. Document mpf_class::mpf_class(mpf_t).
+
 2011-03-07 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* mpn/x86/atom/sse2/sqr_basecase.asm: Postponed pushes. Cleaned
diff -r 71949bf7c948 -r 331ecfff78c3 doc/gmp.texi
--- a/doc/gmp.texi	Wed Mar 09 00:04:44 2011 +0100
+++ b/doc/gmp.texi	Wed Mar 09 12:55:35 2011 +0100
@@ -6486,23 +6486,21 @@
 @node C++ Interface Integers, C++ Interface Rationals, C++ Interface General, C++ Class Interface
 @section C++ Interface Integers
 
- at deftypefun void mpz_class::mpz_class (type @var{n})
+ at deftypefun {} mpz_class::mpz_class (type @var{n})
 Construct an @code{mpz_class}.  All the standard C++ types may be used, except
 @code{long long} and @code{long double}, and all the GMP C++ classes can be
 used.  Any necessary conversion follows the corresponding C function, for
 example @code{double} follows @code{mpz_set_d} (@pxref{Assigning Integers}).
 @end deftypefun
 
- at deftypefun void mpz_class::mpz_class (mpz_t @var{z})
+ at deftypefun explicit mpz_class::mpz_class (mpz_t @var{z})
 Construct an @code{mpz_class} from an @code{mpz_t}.  The value in @var{z} is
 copied into the new @code{mpz_class}, there won't be any permanent association
 between it and @var{z}.
 @end deftypefun
 
- at deftypefun void mpz_class::mpz_class (const char *@var{s})
- at deftypefunx void mpz_class::mpz_class (const char *@var{s}, int @var{base} = 0)
- at deftypefunx void mpz_class::mpz_class (const string& @var{s})
- at deftypefunx void mpz_class::mpz_class (const string& @var{s}, int @var{base} = 0)
+ at deftypefun explicit mpz_class::mpz_class (const char *@var{s}, int @var{base} = 0)
+ at deftypefunx explicit mpz_class::mpz_class (const string& @var{s}, int @var{base} = 0)
 Construct an @code{mpz_class} converted from a string using @code{mpz_set_str}
 (@pxref{Assigning Integers}).
 
@@ -6572,8 +6570,8 @@
 In all the following constructors, if a fraction is given then it should be in
 canonical form, or if not then @code{mpq_class::canonicalize} called.
 
- at deftypefun void mpq_class::mpq_class (type @var{op})
- at deftypefunx void mpq_class::mpq_class (integer @var{num}, integer @var{den})
+ at deftypefun {} mpq_class::mpq_class (type @var{op})
+ at deftypefunx {} mpq_class::mpq_class (integer @var{num}, integer @var{den})
 Construct an @code{mpq_class}.  The initial value can be a single value of any
 type, or a pair of integers (@code{mpz_class} or standard C++ integer types)
 representing a fraction, except that @code{long long} and @code{long double}
@@ -6586,16 +6584,14 @@
 @end example
 @end deftypefun
 
- at deftypefun void mpq_class::mpq_class (mpq_t @var{q})
+ at deftypefun explicit mpq_class::mpq_class (mpq_t @var{q})
 Construct an @code{mpq_class} from an @code{mpq_t}.  The value in @var{q} is
 copied into the new @code{mpq_class}, there won't be any permanent association
 between it and @var{q}.
 @end deftypefun
 
- at deftypefun void mpq_class::mpq_class (const char *@var{s})
- at deftypefunx void mpq_class::mpq_class (const char *@var{s}, int @var{base} = 0)
- at deftypefunx void mpq_class::mpq_class (const string& @var{s})
- at deftypefunx void mpq_class::mpq_class (const string& @var{s}, int @var{base} = 0)
+ at deftypefun explicit mpq_class::mpq_class (const char *@var{s}, int @var{base} = 0)
+ at deftypefunx explicit mpq_class::mpq_class (const string& @var{s}, int @var{base} = 0)
 Construct an @code{mpq_class} converted from a string using @code{mpq_set_str}
 (@pxref{Initializing Rationals}).
 
@@ -6688,10 +6684,20 @@
 @end example
 @end deftypefun
 
- at deftypefun void mpf_class::mpf_class (const char *@var{s})
- at deftypefunx void mpf_class::mpf_class (const char *@var{s}, unsigned long @var{prec}, int @var{base} = 0)
- at deftypefunx void mpf_class::mpf_class (const string& @var{s})
- at deftypefunx void mpf_class::mpf_class (const string& @var{s}, unsigned long @var{prec}, int @var{base} = 0)
+ at deftypefun explicit mpf_class::mpf_class (mpf_t @var{f})
+ at deftypefunx {} mpf_class::mpf_class (mpf_t @var{f}, unsigned long @var{prec})
+Construct an @code{mpf_class} from an @code{mpf_t}.  The value in @var{f} is
+copied into the new @code{mpf_class}, there won't be any permanent association
+between it and @var{f}.
+
+If @var{prec} is given, the initial precision is that value, in bits.  If
+ at var{prec} is not given, then the initial precision is that of @var{f}.
+ at end deftypefun
+
+ at deftypefun explicit mpf_class::mpf_class (const char *@var{s})
+ at deftypefunx {} mpf_class::mpf_class (const char *@var{s}, unsigned long @var{prec}, int @var{base} = 0)
+ at deftypefunx explicit mpf_class::mpf_class (const string& @var{s})
+ at deftypefunx {} mpf_class::mpf_class (const string& @var{s}, unsigned long @var{prec}, int @var{base} = 0)
 Construct an @code{mpf_class} converted from a string using @code{mpf_set_str}
 (@pxref{Assigning Floats}).  If @var{prec} is given, the initial precision is
 that value, in bits.  If not, the default @code{mpf} precision


More information about the gmp-commit mailing list