Boost logo

Boost-Commit :

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


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

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

Modified: sandbox/SOC/2011/checks/boost/checks/basic_check_algorithm.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/basic_check_algorithm.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/basic_check_algorithm.hpp 2011-08-20 10:51:48 EDT (Sat, 20 Aug 2011)
@@ -47,9 +47,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 This will automaticaly throws if the value is not a digit.
+ \throws boost::checks::translation_exception is throwed if the translation of current_value failed.\n This will automaticaly throws if the value is not a digit (0 <= i < 11).
 
- \returns the translation of the current value.
+ \returns the translation of the current value in the range [0..9].
 */
   template <typename value>
   static int translate_to_valid_value(const value &current_value, const unsigned int valid_value_counter )
@@ -57,6 +57,8 @@
     int valid_value = 0;
     try{
       valid_value = boost::lexical_cast<int>( current_value ) ;
+ if( valid_value > 9)
+ throw boost::checks::translation_exception() ;
     }catch( boost::bad_lexical_cast ){
       throw boost::checks::translation_exception() ;
     }


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