Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73835 - sandbox/SOC/2011/checks/boost/checks
From: pierre.talbot.6114_at_[hidden]
Date: 2011-08-16 20:17:43


Author: trademark
Date: 2011-08-16 20:17:43 EDT (Tue, 16 Aug 2011)
New Revision: 73835
URL: http://svn.boost.org/trac/boost/changeset/73835

Log:
Add support for multicheckdigit.
Text files modified:
   sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp | 14 ++++++++++++++
   1 files changed, 14 insertions(+), 0 deletions(-)

Modified: sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp 2011-08-16 20:17:43 EDT (Tue, 16 Aug 2011)
@@ -75,6 +75,20 @@
 }
 
 
+template <typename algorithm, typename check_range, typename checkdigit_iterator>
+typename checkdigit_iterator compute_multicheckdigit (const check_range& check_seq, checkdigit_iterator checkdigits)
+{
+ int checksum = compute_checksum<algorithm, boost::checks::no_null_size_contract<> >( check_seq ) ;
+ return algorithm::compute_multicheckdigit( checksum, checkdigits ) ;
+}
+
+template <typename algorithm, size_t size_expected, typename check_range, typename checkdigit_iterator>
+typename checkdigit_iterator compute_multicheckdigit (const check_range& check_seq, checkdigit_iterator checkdigits)
+{
+ int checksum = compute_checksum<algorithm, boost::checks::strict_size_contract<size_expected> >( check_seq ) ;
+ return algorithm::compute_multicheckdigit( checksum, checkdigits ) ;
+}
+
 }}
 #endif // BOOST_CHECK_BASIC_HPP
 


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