Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73950 - sandbox/SOC/2011/checks/boost/checks
From: pierre.talbot.6114_at_[hidden]
Date: 2011-08-20 10:51:59


Author: trademark
Date: 2011-08-20 10:51:58 EDT (Sat, 20 Aug 2011)
New Revision: 73950
URL: http://svn.boost.org/trac/boost/changeset/73950

Log:
Correct minor bug for the integer value.
Text files modified:
   sandbox/SOC/2011/checks/boost/checks/modulus11.hpp | 6 ++++--
   1 files changed, 4 insertions(+), 2 deletions(-)

Modified: sandbox/SOC/2011/checks/boost/checks/modulus11.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/modulus11.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/modulus11.hpp 2011-08-20 10:51:58 EDT (Sat, 20 Aug 2011)
@@ -46,9 +46,9 @@
     \param current_value is the current value analysed in the sequence that must be translated.
     \param valid_value_counter is the number of valid value already counted (the current value is not included).\n This is also the position (above the valid values) of the current value analysed (0 <= valid_value_counter < n).
 
- \throws boost::checks::translation_exception is throwed if the translation of current_value failed.\n The translation will fail if the current value is not a digit or the 'x' or 'X' character.
+ \throws boost::checks::translation_exception is throwed if the translation of current_value failed.\n The translation will fail if the current value is not a digit (0 <= i < 11) or the 'x' or 'X' character.
 
- \returns the translation of the current value. 10 is returned if the current value was 'X' or 'x'.
+ \returns the translation of the current value in the range [0..10].
 */
   template <typename value>
   static int translate_to_valid_value(const value &current_value, const unsigned int valid_value_counter )
@@ -65,6 +65,8 @@
       else
         throw boost::checks::translation_exception() ;
     }
+ if( valid_value > 10)
+ throw boost::checks::translation_exception() ;
     return valid_value ;
   }
 


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