Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76999 - sandbox/SOC/2011/checks/boost/checks
From: pierre.talbot.6114_at_[hidden]
Date: 2012-02-12 12:45:37


Author: trademark
Date: 2012-02-12 12:45:36 EST (Sun, 12 Feb 2012)
New Revision: 76999
URL: http://svn.boost.org/trac/boost/changeset/76999

Log:
Use filter iterator for skipping value not usefull for the checksum (such as dash, ...). The file filter.hpp provide several predicates (digit_filter, digitx_filter).
Added:
   sandbox/SOC/2011/checks/boost/checks/filter.hpp (contents, props changed)
Text files modified:
   sandbox/SOC/2011/checks/boost/checks/amex.hpp | 4 +-
   sandbox/SOC/2011/checks/boost/checks/basic_check_algorithm.hpp | 7 ---
   sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp | 76 +++++++++++++++++++++++++++------------
   sandbox/SOC/2011/checks/boost/checks/ean.hpp | 8 ++--
   sandbox/SOC/2011/checks/boost/checks/isbn.hpp | 4 +-
   sandbox/SOC/2011/checks/boost/checks/luhn.hpp | 8 ++--
   sandbox/SOC/2011/checks/boost/checks/mastercard.hpp | 4 +-
   sandbox/SOC/2011/checks/boost/checks/modulus11.hpp | 15 ++-----
   sandbox/SOC/2011/checks/boost/checks/modulus97.hpp | 8 ++--
   sandbox/SOC/2011/checks/boost/checks/upc.hpp | 4 +-
   sandbox/SOC/2011/checks/boost/checks/verhoeff.hpp | 8 ++--
   sandbox/SOC/2011/checks/boost/checks/visa.hpp | 4 +-
   12 files changed, 83 insertions(+), 67 deletions(-)

Modified: sandbox/SOC/2011/checks/boost/checks/amex.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/amex.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/amex.hpp 2012-02-12 12:45:36 EST (Sun, 12 Feb 2012)
@@ -49,7 +49,7 @@
 template <typename check_range>
 bool check_amex (const check_range& check_seq)
 {
- return boost::checks::check_sequence<luhn_algorithm, AMEX_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<luhn_algorithm, digit_filter, AMEX_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -69,7 +69,7 @@
 template <typename check_range>
 std::size_t compute_amex(const check_range& check_seq)
 {
- return boost::checks::compute_checkdigit<luhn_algorithm, AMEX_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<luhn_algorithm, digit_filter, AMEX_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 

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 2012-02-12 12:45:36 EST (Sun, 12 Feb 2012)
@@ -19,6 +19,7 @@
 #endif
 
 #include <cstddef> // std::size_t
+#include <boost/checks/filter.hpp>
 
 namespace boost{
   namespace checks{
@@ -31,12 +32,6 @@
 */
 struct basic_check_algorithm
 {
- template <typename value_type>
- static bool skip(const value_type &value)
- {
- return !isdigit(value);
- }
-
   /*!
     \brief translate a value of the sequence into an integer valid value.
 

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 2012-02-12 12:45:36 EST (Sun, 12 Feb 2012)
@@ -19,6 +19,7 @@
 #include <cstddef> // std::size_t
 
 #include <boost/checks/detail/sequence_counter.hpp>
+#include <boost/iterator/filter_iterator.hpp>
 
 namespace boost {
   namespace checks{
@@ -49,12 +50,9 @@
   std::size_t checksum = 0;
   for(; seq_begin != seq_end && *counter < size_expected; ++seq_begin)
   {
- if(!algorithm::skip(*seq_begin))
- {
- std::size_t value = algorithm::convert(*seq_begin);
- checksum = algorithm::process(checksum, value, *counter);
- ++counter;
- }
+ std::size_t value = algorithm::convert(*seq_begin);
+ checksum = algorithm::process(checksum, value, *counter);
+ ++counter;
   }
   if(*counter != size_expected || seq_begin != seq_end)
     return bad_sequence;
@@ -69,12 +67,9 @@
   std::size_t checksum = 0;
   for(; seq_begin != seq_end; ++seq_begin)
   {
- if(!algorithm::skip(*seq_begin))
- {
- std::size_t value = algorithm::convert(*seq_begin);
- checksum = algorithm::process(checksum, value, *counter);
- ++counter;
- }
+ std::size_t value = algorithm::convert(*seq_begin);
+ checksum = algorithm::process(checksum, value, *counter);
+ ++counter;
   }
   return checksum;
 }
@@ -92,12 +87,17 @@
 
     \returns @c true if the checkdigit is correct, @c false otherwise.
 */
-template <typename algorithm,
+template <typename algorithm,
+ typename UnaryPredicate,
           typename seq_iterator>
 bool check_sequence(seq_iterator seq_begin, seq_iterator seq_end)
 {
   boost::checks::detail::simple_counter::type counter = boost::checks::detail::simple_counter()();
- std::size_t checksum = compute_checksum<algorithm>(seq_begin, seq_end, counter);
+ typedef boost::filter_iterator<UnaryPredicate, seq_iterator> skip_iterator;
+ UnaryPredicate predicate;
+ std::size_t checksum = compute_checksum<algorithm>(skip_iterator(predicate, seq_begin, seq_end),
+ skip_iterator(predicate, seq_end, seq_end),
+ counter);
   return algorithm::validate_checksum(checksum);
 }
 
@@ -115,13 +115,18 @@
 
     \returns @c true if the checkdigit is correct, @c false otherwise.
 */
-template <typename algorithm,
+template <typename algorithm,
+ typename UnaryPredicate,
           std::size_t size_expected,
           typename seq_iterator>
 bool check_sequence(seq_iterator seq_begin, seq_iterator seq_end)
 {
+ typedef boost::filter_iterator<UnaryPredicate, seq_iterator> skip_iterator;
+ UnaryPredicate predicate;
   boost::checks::detail::simple_counter::type counter = boost::checks::detail::simple_counter()();
- std::size_t checksum = compute_checksum<algorithm, size_expected>(seq_begin, seq_end, counter);
+ std::size_t checksum = compute_checksum<algorithm, size_expected>(skip_iterator(predicate, seq_begin, seq_end),
+ skip_iterator(predicate, seq_end, seq_end),
+ counter);
   if(checksum != bad_sequence)
     return algorithm::validate_checksum(checksum);
   return false;
@@ -140,14 +145,19 @@
 
     \returns The check digit of the type of a value in check_seq.
 */
-template <typename algorithm,
+template <typename algorithm,
+ typename UnaryPredicate,
           typename checkdigit,
           typename seq_iterator>
 std::size_t compute_checkdigit(seq_iterator seq_begin, seq_iterator seq_end)
 {
+ typedef boost::filter_iterator<UnaryPredicate, seq_iterator> skip_iterator;
+ UnaryPredicate predicate;
   typedef typename boost::checks::detail::skip_counter<checkdigit::pos, checkdigit::size> counter_type;
   typename counter_type::type counter = counter_type()();
- std::size_t checksum = compute_checksum<algorithm>(seq_begin, seq_end, counter);
+ std::size_t checksum = compute_checksum<algorithm>(skip_iterator(predicate, seq_begin, seq_end),
+ skip_iterator(predicate, seq_end, seq_end),
+ counter);
   return algorithm::compute_checkdigit(checksum);
 }
 
@@ -165,15 +175,21 @@
 
     \returns The check digit of the type of a value in check_seq.
 */
-template <typename algorithm,
+template <typename algorithm,
+ typename UnaryPredicate,
           std::size_t size_expected,
           typename checkdigit,
           typename seq_iterator>
 std::size_t compute_checkdigit(seq_iterator seq_begin, seq_iterator seq_end)
 {
+ typedef boost::filter_iterator<UnaryPredicate, seq_iterator> skip_iterator;
+ UnaryPredicate predicate;
+
   typedef typename boost::checks::detail::skip_counter<checkdigit::pos, checkdigit::size> counter_type;
   typename counter_type::type counter = counter_type()();
- std::size_t checksum = compute_checksum<algorithm, size_expected>(seq_begin, seq_end, counter);
+ std::size_t checksum = compute_checksum<algorithm, size_expected>(skip_iterator(predicate, seq_begin, seq_end),
+ skip_iterator(predicate, seq_end, seq_end),
+ counter);
   if(checksum != size_expected)
     return algorithm::compute_checkdigit(checksum);
   return bad_sequence;
@@ -195,14 +211,20 @@
 
     \returns An iterator initialized at one pass the end of checkdigits.
 */
-template <typename algorithm,
+template <typename algorithm,
+ typename UnaryPredicate,
           typename checkdigit,
           typename seq_iterator>
 std::pair<std::size_t, std::size_t> compute_multicheckdigit (seq_iterator seq_begin, seq_iterator seq_end)
 {
+ typedef boost::filter_iterator<UnaryPredicate, seq_iterator> skip_iterator;
+ UnaryPredicate predicate;
+
   typedef typename boost::checks::detail::skip_counter<checkdigit::pos, checkdigit::size> counter_type;
   typename counter_type::type counter = counter_type()();
- std::size_t checksum = compute_checksum<algorithm>(seq_begin, seq_end, counter);
+ std::size_t checksum = compute_checksum<algorithm>(skip_iterator(predicate, seq_begin, seq_end),
+ skip_iterator(predicate, seq_end, seq_end),
+ counter);
   return algorithm::compute_multicheckdigit(checksum);
 }
 
@@ -222,15 +244,21 @@
 
     \returns An iterator initialized at one pass the end of checkdigits.
 */
-template <typename algorithm,
+template <typename algorithm,
+ typename UnaryPredicate,
           std::size_t size_expected,
           typename checkdigit,
           typename seq_iterator>
 std::pair<std::size_t, std::size_t> compute_multicheckdigit(seq_iterator seq_begin, seq_iterator seq_end)
 {
+ typedef boost::filter_iterator<UnaryPredicate, seq_iterator> skip_iterator;
+ UnaryPredicate predicate;
+
   typedef typename boost::checks::detail::skip_counter<checkdigit::pos, checkdigit::size> counter_type;
   typename counter_type::type counter = counter_type()();
- std::size_t checksum = compute_checksum<algorithm, size_expected>(seq_begin, seq_end, counter);
+ std::size_t checksum = compute_checksum<algorithm, size_expected>(skip_iterator(predicate, seq_begin, seq_end),
+ skip_iterator(predicate, seq_end, seq_end),
+ counter);
   if(checksum != bad_sequence)
     return algorithm::compute_multicheckdigit(checksum);
   return std::pair<std::size_t, std::size_t>(bad_sequence, bad_sequence);

Modified: sandbox/SOC/2011/checks/boost/checks/ean.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/ean.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/ean.hpp 2012-02-12 12:45:36 EST (Sun, 12 Feb 2012)
@@ -61,7 +61,7 @@
 template <typename check_range>
 bool check_ean13(const check_range& check_seq)
 {
- return boost::checks::check_sequence<ean_algorithm, EAN13_SIZE> (boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<ean_algorithm, digit_filter, EAN13_SIZE> (boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -80,7 +80,7 @@
 template <typename check_range>
 std::size_t compute_ean13(const check_range& check_seq)
 {
- return boost::checks::compute_checkdigit<ean_algorithm, EAN13_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<ean_algorithm, digit_filter, EAN13_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -98,7 +98,7 @@
 template <typename check_range>
 bool check_ean8 (const check_range& check_seq)
 {
- return boost::checks::check_sequence<ean_algorithm, EAN8_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<ean_algorithm, digit_filter, EAN8_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -117,7 +117,7 @@
 template <typename check_range>
 std::size_t compute_ean8(const check_range& check_seq)
 {
- return boost::checks::compute_checkdigit<ean_algorithm, EAN8_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<ean_algorithm, digit_filter, EAN8_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 

Added: sandbox/SOC/2011/checks/boost/checks/filter.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2011/checks/boost/checks/filter.hpp 2012-02-12 12:45:36 EST (Sun, 12 Feb 2012)
@@ -0,0 +1,45 @@
+// Boost checks/filter.hpp header file
+// (C) Copyright Pierre Talbot 2012
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org for updates, documentation, and revision history.
+
+/*! \file
+ \brief Provides a type "checkdigit"
+*/
+
+#ifndef BOOST_CHECK_FILTER_HPP
+#define BOOST_CHECK_FILTER_HPP
+
+#ifdef _MSC_VER
+ #pragma once
+#endif
+
+#include <cstddef> // std::size_t
+#include <cctype>
+
+namespace boost{
+ namespace checks{
+
+struct digit_filter
+{
+ template <typename value_type>
+ bool operator()(const value_type &value)
+ {
+ return std::isdigit(static_cast<int>(value));
+ }
+};
+
+struct digitx_filter
+{
+ template <typename value_type>
+ bool operator()(const value_type &value)
+ {
+ return std::isdigit(static_cast<int>(value)) || std::tolower(static_cast<int>(value)) == 'x';
+ }
+};
+
+}} // namespace boost namespace checks
+
+#endif //BOOST_CHECK_CHECKDIGIT_HPP

Modified: sandbox/SOC/2011/checks/boost/checks/isbn.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/isbn.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/isbn.hpp 2012-02-12 12:45:36 EST (Sun, 12 Feb 2012)
@@ -56,7 +56,7 @@
 template <typename check_range>
 bool check_isbn13 (const check_range& check_seq)
 {
- return boost::checks::check_sequence<isbn13_algorithm, EAN13_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<isbn13_algorithm, digit_filter, EAN13_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -75,7 +75,7 @@
 template <typename check_range>
 std::size_t compute_isbn13 (const check_range& check_seq)
 {
- return boost::checks::compute_checkdigit<isbn13_algorithm, EAN13_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<isbn13_algorithm, digit_filter, EAN13_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!

Modified: sandbox/SOC/2011/checks/boost/checks/luhn.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/luhn.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/luhn.hpp 2012-02-12 12:45:36 EST (Sun, 12 Feb 2012)
@@ -90,7 +90,7 @@
 template <size_t size_expected, typename check_range>
 bool check_luhn (const check_range& check_seq)
 {
- return boost::checks::check_sequence<luhn_algorithm, size_expected>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<luhn_algorithm, digit_filter, size_expected>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -108,7 +108,7 @@
 template <typename check_range>
 bool check_luhn (const check_range& check_seq)
 {
- return boost::checks::check_sequence<luhn_algorithm> (boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<luhn_algorithm, digit_filter> (boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -128,7 +128,7 @@
 template <size_t size_expected, typename check_range>
 std::size_t compute_luhn(const check_range& check_seq)
 {
- return boost::checks::compute_checkdigit<luhn_algorithm, size_expected, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<luhn_algorithm, digit_filter, size_expected, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -147,7 +147,7 @@
 template <typename check_range>
 std::size_t compute_luhn (const check_range& check_seq)
 {
- return boost::checks::compute_checkdigit<luhn_algorithm, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<luhn_algorithm, digit_filter, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 

Modified: sandbox/SOC/2011/checks/boost/checks/mastercard.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/mastercard.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/mastercard.hpp 2012-02-12 12:45:36 EST (Sun, 12 Feb 2012)
@@ -47,7 +47,7 @@
 template <typename check_range>
 bool check_mastercard(const check_range& check_seq)
 {
- return boost::checks::check_sequence<luhn_algorithm, MASTERCARD_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<luhn_algorithm, digit_filter, MASTERCARD_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -67,7 +67,7 @@
 template <typename check_range>
 std::size_t compute_mastercard(const check_range& check_seq)
 {
- return boost::checks::compute_checkdigit<luhn_algorithm, MASTERCARD_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<luhn_algorithm, digit_filter, MASTERCARD_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 

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 2012-02-12 12:45:36 EST (Sun, 12 Feb 2012)
@@ -39,13 +39,6 @@
 template <typename mod11_weight>
 struct modulus11_algorithm : boost::checks::weighted_sum_algorithm<mod11_weight>
 {
-
- template <typename value_type>
- static bool skip(const value_type &value)
- {
- return !isdigit(value) && value != 'x' && value != 'X';
- }
-
   /*!
     \brief translate the current value into an integer valid value.
 
@@ -126,7 +119,7 @@
 template <size_t size_expected, typename check_range>
 bool check_modulus11(const check_range& check_seq)
 {
- return boost::checks::check_sequence<mod11_algorithm, size_expected>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<mod11_algorithm, digitx_filter, size_expected>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -144,7 +137,7 @@
 template <typename check_range>
 bool check_modulus11(const check_range& check_seq)
 {
- return boost::checks::check_sequence<mod11_algorithm>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<mod11_algorithm, digitx_filter>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -164,7 +157,7 @@
 template <std::size_t size_expected, typename check_range>
 std::size_t compute_modulus11(const check_range& check_seq)
 {
- return boost::checks::compute_checkdigit<mod11_algorithm, size_expected, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<mod11_algorithm, digitx_filter, size_expected, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -183,7 +176,7 @@
 template <typename check_range>
 std::size_t compute_modulus11(const check_range& check_seq)
 {
- return boost::checks::compute_checkdigit<mod11_algorithm, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<mod11_algorithm, digitx_filter, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 }} // namespace boost namespace checks

Modified: sandbox/SOC/2011/checks/boost/checks/modulus97.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/modulus97.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/modulus97.hpp 2012-02-12 12:45:36 EST (Sun, 12 Feb 2012)
@@ -138,7 +138,7 @@
 template <size_t size_expected, typename check_range>
 bool check_mod97_10 (const check_range& check_seq)
 {
- return boost::checks::check_sequence<mod97_10_algorithm, size_expected> (boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<mod97_10_algorithm, digit_filter, size_expected> (boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -156,7 +156,7 @@
 template <typename check_range>
 bool check_mod97_10(const check_range& check_seq)
 {
- return boost::checks::check_sequence<mod97_10_algorithm>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<mod97_10_algorithm, digit_filter>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -178,7 +178,7 @@
 template <size_t size_expected, typename check_range>
 std::pair<std::size_t, std::size_t> compute_mod97_10(const check_range& check_seq)
 {
- return boost::checks::compute_multicheckdigit<mod97_10_algorithm, mod97_10_checkdigit, size_expected>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_multicheckdigit<mod97_10_algorithm, digit_filter, mod97_10_checkdigit, size_expected>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -199,7 +199,7 @@
 template <typename check_range>
 std::pair<std::size_t, std::size_t> compute_mod97_10(const check_range& check_seq)
 {
- return boost::checks::compute_multicheckdigit<mod97_10_algorithm, mod97_10_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_multicheckdigit<mod97_10_algorithm, digit_filter, mod97_10_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 

Modified: sandbox/SOC/2011/checks/boost/checks/upc.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/upc.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/upc.hpp 2012-02-12 12:45:36 EST (Sun, 12 Feb 2012)
@@ -57,7 +57,7 @@
 template <typename check_range>
 bool check_upca (const check_range& check_seq)
 {
- return boost::checks::check_sequence<upc_algorithm, UPCA_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<upc_algorithm, digit_filter, UPCA_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -76,7 +76,7 @@
 template <typename check_range>
 std::size_t compute_upca(const check_range& check_seq)
 {
- return boost::checks::compute_checkdigit<upc_algorithm, UPCA_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<upc_algorithm, digit_filter, UPCA_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 }} // namespace boost namespace checks

Modified: sandbox/SOC/2011/checks/boost/checks/verhoeff.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/verhoeff.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/verhoeff.hpp 2012-02-12 12:45:36 EST (Sun, 12 Feb 2012)
@@ -126,7 +126,7 @@
 template <size_t size_expected, typename check_range>
 bool check_verhoeff(const check_range& check_seq)
 {
- return boost::checks::check_sequence<verhoeff_algorithm, size_expected>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<verhoeff_algorithm, digit_filter, size_expected>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -144,7 +144,7 @@
 template <typename check_range>
 bool check_verhoeff(const check_range& check_seq)
 {
- return boost::checks::check_sequence<verhoeff_algorithm>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<verhoeff_algorithm, digit_filter>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -164,7 +164,7 @@
 template <size_t size_expected, typename check_range>
 std::size_t compute_verhoeff(const check_range& check_seq)
 {
- return boost::checks::compute_checkdigit<verhoeff_algorithm, size_expected, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<verhoeff_algorithm, digit_filter, size_expected, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -183,7 +183,7 @@
 template <typename check_range>
 std::size_t compute_verhoeff(const check_range& check_seq)
 {
- return boost::checks::compute_checkdigit<verhoeff_algorithm, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<verhoeff_algorithm, digit_filter, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 }}

Modified: sandbox/SOC/2011/checks/boost/checks/visa.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/visa.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/visa.hpp 2012-02-12 12:45:36 EST (Sun, 12 Feb 2012)
@@ -47,7 +47,7 @@
 template <typename check_range>
 bool check_visa(const check_range& check_seq)
 {
- return boost::checks::check_sequence<luhn_algorithm, VISA_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<luhn_algorithm, digit_filter, VISA_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 /*!
@@ -67,7 +67,7 @@
 template <typename check_range>
 std::size_t compute_visa(const check_range& check_seq)
 {
- return boost::checks::compute_checkdigit<luhn_algorithm, VISA_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<luhn_algorithm, digit_filter, VISA_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
 }
 
 


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