[Boost-bugs] [Boost C++ Libraries] #2763: 'variant' documentation: bug in times_two() example

Subject: [Boost-bugs] [Boost C++ Libraries] #2763: 'variant' documentation: bug in times_two() example
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-02-16 19:02:54


#2763: 'variant' documentation: bug in times_two() example
-----------------------------------+----------------------------------------
 Reporter: dan.tsafrir_at_[hidden] | Owner: ebf
     Type: Bugs | Status: new
Milestone: Boost 1.39.0 | Component: variant
  Version: Boost 1.38.0 | Severity: Problem
 Keywords: documentation |
-----------------------------------+----------------------------------------
 This page:

     http://www.boost.org/doc/libs/1_38_0/doc/html/variant/tutorial.html

 defines the following code snippet:

   void times_two( boost::variant< int, std::string > & operand )
   {
     if ( int* pi = boost::get<int>( &v ) )
         *pi *= 2;
     else if ( std::string* pstr = boost::get<std::string>( &v ) )
         *pstr += *pstr;
   }

 in which (1) 'v' is not defined and (2) 'operand' is not used. I suspect
 that this is not intentional, but rather, a mistake. Specifically, it
 seems that every occurrence of 'v' should be replaced by 'operand'.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2763>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC