|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r77016 - sandbox/SOC/2011/checks/boost/checks
From: pierre.talbot.6114_at_[hidden]
Date: 2012-02-14 13:19:05
Author: trademark
Date: 2012-02-14 13:19:03 EST (Tue, 14 Feb 2012)
New Revision: 77016
URL: http://svn.boost.org/trac/boost/changeset/77016
Log:
Correct bugs under MSVC compilers. Tests passed now for the prechecksum.
Text files modified:
sandbox/SOC/2011/checks/boost/checks/amex.hpp | 4 +-
sandbox/SOC/2011/checks/boost/checks/basic_check_algorithm.hpp | 16 +----------
sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp | 2
sandbox/SOC/2011/checks/boost/checks/conversion.hpp | 14 ++++++---
sandbox/SOC/2011/checks/boost/checks/ean.hpp | 8 ++--
sandbox/SOC/2011/checks/boost/checks/filter.hpp | 16 +++++++----
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 | 8 ++--
sandbox/SOC/2011/checks/boost/checks/modulus97.hpp | 8 ++--
sandbox/SOC/2011/checks/boost/checks/prechecksum.hpp | 54 +++++++++++++++++++++++++--------------
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 +-
15 files changed, 87 insertions(+), 75 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-14 13:19:03 EST (Tue, 14 Feb 2012)
@@ -51,7 +51,7 @@
template <typename check_range>
bool check_amex (const check_range& check_seq)
{
- return boost::checks::check_sequence<luhn_algorithm, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type, AMEX_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<luhn_algorithm, digit_prechecksum, AMEX_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
}
/*!
@@ -71,7 +71,7 @@
template <typename check_range>
std::size_t compute_amex(const check_range& check_seq)
{
- return boost::checks::compute_checkdigit<luhn_algorithm, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type, AMEX_SIZE, basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<luhn_algorithm, digit_prechecksum, AMEX_SIZE, 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-14 13:19:03 EST (Tue, 14 Feb 2012)
@@ -28,21 +28,9 @@
namespace checks{
-template <typename Iterator>
-struct digit_prechecksum
-{
- typedef prechecksum<digit_filter<typename Iterator::value_type>,
- chartodigit<typename Iterator::value_type>,
- Iterator> type;
-};
+typedef prechecksum<digit_filter, chartodigit> digit_prechecksum;
-template <typename Iterator>
-struct digitx_prechecksum
-{
- typedef prechecksum<digitx_filter<typename Iterator::value_type>,
- chartodigitx<typename Iterator::value_type>,
- Iterator> type;
-};
+typedef prechecksum<digitx_filter, chartodigitx> digitx_prechecksum;
/*! \class basic_check_algorithm
\brief The main check algorithm class that provides every static function that can be overloaded.\n Most of the functions must be re-implemented to have the desired behavior.
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-14 13:19:03 EST (Tue, 14 Feb 2012)
@@ -27,7 +27,7 @@
struct no_prechecksum_tag {};
-static const std::size_t bad_sequence = -1;
+static const std::size_t bad_sequence = (std::size_t)-1;
/*!
\brief Run through a sequence and calculate the checksum with the algorithm policy class.
Modified: sandbox/SOC/2011/checks/boost/checks/conversion.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/conversion.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/conversion.hpp 2012-02-14 13:19:03 EST (Tue, 14 Feb 2012)
@@ -17,25 +17,29 @@
#endif
#include <cstddef> // std::size_t
-#include <cctype>
#include <functional>
namespace boost{
namespace checks{
-template <typename value_type>
-struct chartodigit : public std::unary_function<value_type, std::size_t>
+struct chartodigit
{
+ typedef std::size_t result_type;
+
+ template <typename value_type>
std::size_t operator()(const value_type &value) const
{
return value - '0';
}
};
-template <typename value_type>
-struct chartodigitx : public std::unary_function<value_type, std::size_t>
+
+struct chartodigitx
{
+ typedef std::size_t result_type;
+
+ template <typename value_type>
std::size_t operator()(const value_type &value) const
{
return value <= '9' ? (value - '0') : 10;
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-14 13:19:03 EST (Tue, 14 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type, EAN13_SIZE> (boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<ean_algorithm, digit_prechecksum, 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type, EAN13_SIZE, basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<ean_algorithm, digit_prechecksum, EAN13_SIZE, 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type, EAN8_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<ean_algorithm, digit_prechecksum, 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type, EAN8_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<ean_algorithm, digit_prechecksum, EAN8_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
}
Modified: sandbox/SOC/2011/checks/boost/checks/filter.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/filter.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/filter.hpp 2012-02-14 13:19:03 EST (Tue, 14 Feb 2012)
@@ -23,21 +23,25 @@
namespace boost{
namespace checks{
-template <typename value_type>
-struct digit_filter : public std::unary_function<value_type, bool>
+struct digit_filter
{
+ typedef bool result_type;
+
+ template <typename value_type>
bool operator()(const value_type &value)
{
- return std::isdigit(static_cast<int>(value));
+ return value >= '0' && value <= '9';
}
};
-template <typename value_type>
-struct digitx_filter : public std::unary_function<value_type, bool>
+struct digitx_filter
{
+ typedef bool result_type;
+
+ template <typename value_type>
bool operator()(const value_type &value)
{
- return std::isdigit(static_cast<int>(value)) || std::tolower(static_cast<int>(value)) == 'x';
+ return (value >= '0' && value <= '9') || std::tolower(value) == 'x';
}
};
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-14 13:19:03 EST (Tue, 14 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type, EAN13_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<isbn13_algorithm, digit_prechecksum, 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type, EAN13_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<isbn13_algorithm, digit_prechecksum, 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-14 13:19:03 EST (Tue, 14 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type, size_expected>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<luhn_algorithm, digit_prechecksum, 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type> (boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<luhn_algorithm, digit_prechecksum (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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type, size_expected, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<luhn_algorithm, digit_prechecksum, 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<luhn_algorithm, digit_prechecksum, 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-14 13:19:03 EST (Tue, 14 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>, MASTERCARD_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<luhn_algorithm, digit_prechecksum, 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>, MASTERCARD_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<luhn_algorithm, digit_prechecksum, 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-14 13:19:03 EST (Tue, 14 Feb 2012)
@@ -93,7 +93,7 @@
template <size_t size_expected, typename check_range>
bool check_modulus11(const check_range& check_seq)
{
- return boost::checks::check_sequence<mod11_algorithm, typename digitx_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type, size_expected>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<mod11_algorithm, digitx_prechecksum, size_expected>(boost::rbegin(check_seq), boost::rend(check_seq));
}
/*!
@@ -111,7 +111,7 @@
template <typename check_range>
bool check_modulus11(const check_range& check_seq)
{
- return boost::checks::check_sequence<mod11_algorithm, typename digitx_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<mod11_algorithm, digitx_prechecksum>(boost::rbegin(check_seq), boost::rend(check_seq));
}
/*!
@@ -131,7 +131,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, typename digitx_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type, size_expected, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<mod11_algorithm, digitx_prechecksum, size_expected, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
}
/*!
@@ -150,7 +150,7 @@
template <typename check_range>
std::size_t compute_modulus11(const check_range& check_seq)
{
- return boost::checks::compute_checkdigit<mod11_algorithm, typename digitx_prechecksum<typename boost::range_reverse_iterator<check_range>::type>::type, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<mod11_algorithm, digitx_prechecksum, 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-14 13:19:03 EST (Tue, 14 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>, size_expected> (boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<mod97_10_algorithm, digit_prechecksum, 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type> >(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<mod97_10_algorithm, digit_prechecksum >(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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>, mod97_10_checkdigit, size_expected>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_multicheckdigit<mod97_10_algorithm, digit_prechecksum, 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>, mod97_10_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_multicheckdigit<mod97_10_algorithm, digit_prechecksum, mod97_10_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
}
Modified: sandbox/SOC/2011/checks/boost/checks/prechecksum.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/prechecksum.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/prechecksum.hpp 2012-02-14 13:19:03 EST (Tue, 14 Feb 2012)
@@ -26,53 +26,69 @@
struct no_conversion_tag {};
template <typename UnaryPredicate,
- typename UnaryFunction,
- typename BaseIterator>
+ typename UnaryFunction>
struct prechecksum
{
typedef UnaryPredicate FilterPredicate;
typedef UnaryFunction ConversionFunction;
- typedef typename boost::filter_iterator<FilterPredicate, BaseIterator> filter_iterator;
-
- typedef typename boost::transform_iterator<ConversionFunction, filter_iterator> iterator;
+ template <typename BaseIterator>
+ struct iterator
+ {
+ typedef typename boost::transform_iterator<ConversionFunction,
+ boost::filter_iterator<FilterPredicate,
+ BaseIterator> > type;
+ };
FilterPredicate filter;
ConversionFunction converter;
- iterator operator()(BaseIterator b, BaseIterator e)
+ template <typename BaseIterator>
+ typename iterator<BaseIterator>::type operator()(BaseIterator b, BaseIterator e)
{
- return iterator(filter_iterator(filter, b, e), converter);
+ return iterator<BaseIterator>::type(boost::filter_iterator<FilterPredicate, BaseIterator>(filter, b, e),
+ converter);
}
};
-template <typename UnaryFunction,
- typename BaseIterator>
-struct prechecksum<no_filter_tag, UnaryFunction, BaseIterator>
+template <typename UnaryFunction>
+struct prechecksum<no_filter_tag, UnaryFunction>
{
typedef UnaryFunction ConversionFunction;
- typedef typename boost::transform_iterator<ConversionFunction, BaseIterator> iterator;
+ template <typename BaseIterator>
+ struct iterator
+ {
+ typedef typename boost::transform_iterator<ConversionFunction,
+ BaseIterator> type;
+ };
ConversionFunction converter;
- iterator operator()(BaseIterator b, BaseIterator e)
+
+ template <typename BaseIterator>
+ typename iterator<BaseIterator>::type operator()(BaseIterator b, BaseIterator e)
{
- return iterator(b, converter);
+ return iterator<BaseIterator>::type(b, converter);
}
};
-template <typename UnaryPredicate,
- typename BaseIterator>
-struct prechecksum<UnaryPredicate, no_conversion_tag, BaseIterator>
+template <typename UnaryPredicate>
+struct prechecksum<UnaryPredicate, no_conversion_tag>
{
typedef UnaryPredicate FilterPredicate;
- typedef typename boost::filter_iterator<FilterPredicate, BaseIterator> iterator;
+ template <typename BaseIterator>
+ struct iterator
+ {
+ typedef typename boost::filter_iterator<FilterPredicate, BaseIterator> type;
+ };
FilterPredicate filter;
- iterator operator()(BaseIterator b, BaseIterator e)
+
+ template <typename BaseIterator>
+ typename iterator<BaseIterator>::type operator()(BaseIterator b, BaseIterator e)
{
- return iterator(filter, b, e);
+ return iterator<BaseIterator>::type(filter, b, e);
}
};
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-14 13:19:03 EST (Tue, 14 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>, UPCA_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<upc_algorithm, digit_prechecksum, 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>, UPCA_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<upc_algorithm, digit_prechecksum, 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-14 13:19:03 EST (Tue, 14 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>, size_expected>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<verhoeff_algorithm, digit_prechecksum, 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type> >(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<verhoeff_algorithm, digit_prechecksum >(boost::rbegin(check_seq), boost::rend(check_seq));
}
/*!
@@ -165,7 +165,7 @@
std::size_t compute_verhoeff(const check_range& check_seq)
{
return boost::checks::compute_checkdigit<verhoeff_algorithm,
- typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>,
+ digit_prechecksum,
size_expected,
basic_checkdigit>
(boost::rbegin(check_seq), boost::rend(check_seq));
@@ -188,7 +188,7 @@
std::size_t compute_verhoeff(const check_range& check_seq)
{
return boost::checks::compute_checkdigit<verhoeff_algorithm,
- typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>,
+ digit_prechecksum,
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-14 13:19:03 EST (Tue, 14 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>, VISA_SIZE>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::check_sequence<luhn_algorithm, digit_prechecksum, 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, typename digit_prechecksum<typename boost::range_reverse_iterator<check_range>::type>, VISA_SIZE, boost::checks::basic_checkdigit>(boost::rbegin(check_seq), boost::rend(check_seq));
+ return boost::checks::compute_checkdigit<luhn_algorithm, digit_prechecksum, 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