Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65125 - trunk/libs/math/example
From: pbristow_at_[hidden]
Date: 2010-08-30 05:10:08


Author: pbristow
Date: 2010-08-30 05:10:05 EDT (Mon, 30 Aug 2010)
New Revision: 65125
URL: http://svn.boost.org/trac/boost/changeset/65125

Log:
Avoid name ambiguity.
Text files modified:
   trunk/libs/math/example/distribution_construction.cpp | 14 ++++++--------
   1 files changed, 6 insertions(+), 8 deletions(-)

Modified: trunk/libs/math/example/distribution_construction.cpp
==============================================================================
--- trunk/libs/math/example/distribution_construction.cpp (original)
+++ trunk/libs/math/example/distribution_construction.cpp 2010-08-30 05:10:05 EDT (Mon, 30 Aug 2010)
@@ -1,6 +1,6 @@
 // distribution_construction.cpp
 
-// Copyright Paul A. Bristow 2007.
+// Copyright Paul A. Bristow 2007, 2010.
 
 // Use, modification and distribution are subject to the
 // Boost Software License, Version 1.0.
@@ -39,9 +39,6 @@
 */
 //] [/distribution_construction1 end of Quickbook in C++ markup]
 
-
-
-
 int main()
 {
 //[distribution_construction2
@@ -51,15 +48,16 @@
 */
   boost::math::negative_binomial_distribution<double> mydist0(8., 0.25);
   /*`
- But this is inconveniently long, so by writing
+ But this is inconveniently long, so we might be tempted to write
   */
- using namespace boost::math;
+ using namespace boost::math;
   /*`
- or
+ but this might risk ambiguity with names in std random so *much better* is
+ explicit 'using boost::math:: ' ... statements like
   */
   using boost::math::negative_binomial_distribution;
   /*`
- we can reduce typing.
+ and we can still reduce typing.
 
   Since the vast majority of applications use will be using double precision,
   the template argument to the distribution (RealType) defaults


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk