|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r82448 - in sandbox/SOC/2011/checks/boost/checks: . detail
From: pierre.talbot.6114_at_[hidden]
Date: 2013-01-11 15:48:27
Author: trademark
Date: 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
New Revision: 82448
URL: http://svn.boost.org/trac/boost/changeset/82448
Log:
The std::size t change to size t. The code is clearer now, I guess.
Text files modified:
sandbox/SOC/2011/checks/boost/checks/amex.hpp | 6 +++---
sandbox/SOC/2011/checks/boost/checks/basic_checks.hpp | 14 +++++++-------
sandbox/SOC/2011/checks/boost/checks/checkdigit.hpp | 10 +++++-----
sandbox/SOC/2011/checks/boost/checks/checksum.hpp | 10 +++++-----
sandbox/SOC/2011/checks/boost/checks/conversion.hpp | 10 +++++-----
sandbox/SOC/2011/checks/boost/checks/detail/sequence_counter.hpp | 10 +++++-----
sandbox/SOC/2011/checks/boost/checks/ean.hpp | 8 ++++----
sandbox/SOC/2011/checks/boost/checks/filter.hpp | 2 +-
sandbox/SOC/2011/checks/boost/checks/isbn.hpp | 8 ++++----
sandbox/SOC/2011/checks/boost/checks/luhn.hpp | 8 ++++----
sandbox/SOC/2011/checks/boost/checks/modulus10.hpp | 4 ++--
sandbox/SOC/2011/checks/boost/checks/modulus11.hpp | 10 +++++-----
sandbox/SOC/2011/checks/boost/checks/modulus97.hpp | 6 +++---
sandbox/SOC/2011/checks/boost/checks/upc.hpp | 4 ++--
sandbox/SOC/2011/checks/boost/checks/verhoeff.hpp | 10 +++++-----
sandbox/SOC/2011/checks/boost/checks/visa.hpp | 4 ++--
sandbox/SOC/2011/checks/boost/checks/weight.hpp | 14 +++++++-------
sandbox/SOC/2011/checks/boost/checks/weighted_sum.hpp | 2 +-
18 files changed, 70 insertions(+), 70 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 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -16,7 +16,7 @@
#pragma once
#endif
-#include <cstddef> // std::size_t
+#include <cstddef> // size_t
#include <boost/checks/luhn.hpp>
#include <boost/checks/checksum.hpp>
@@ -78,12 +78,12 @@
\see compute_checkdigit bad_sequence amex AMEX_SIZE
*/
template <typename range>
-std::size_t compute_amex(const range& x)
+size_t compute_amex(const range& x)
{
return compute_checkdigit<amex>(x);
}
-std::size_t compute_amex(const std::string& x)
+size_t compute_amex(const std::string& x)
{
return compute_checkdigit<amex>(make_precheck<digit>(x));
}
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 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -16,7 +16,7 @@
#pragma once
#endif
-#include <cstddef> // std::size_t
+#include <cstddef> // size_t
#include <boost/checks/detail/sequence_counter.hpp>
#include <boost/iterator/filter_iterator.hpp>
@@ -24,7 +24,7 @@
namespace boost {
namespace checks{
-static const std::size_t bad_sequence = (std::size_t)-1;
+static const size_t bad_sequence = (size_t)-1;
/*!
\brief Run through a sequence and calculate the checksum with the algorithm policy class.
@@ -46,10 +46,10 @@
typename sizePolicy,
typename iterator,
typename counter_iter>
-std::size_t compute_checksum(iterator begin, iterator end, counter_iter &counter)
+size_t compute_checksum(iterator begin, iterator end, counter_iter &counter)
{
processor process;
- std::size_t checksum = 0;
+ size_t checksum = 0;
for(; begin != end && sizePolicy::check(*counter); ++begin, ++counter)
checksum = process(checksum, *begin, *counter);
@@ -76,7 +76,7 @@
bool check_sequence(const range &x)
{
boost::checks::detail::simple_counter::type counter = boost::checks::detail::simple_counter()();
- std::size_t checksum;
+ size_t checksum;
checksum = compute_checksum<typename features::checksum::processor,
typename features::size_policy>
@@ -101,14 +101,14 @@
*/
template <typename features,
typename range>
-std::size_t compute_checkdigit(const range &x)
+size_t compute_checkdigit(const range &x)
{
typedef typename boost::checks::detail::skip_counter<features::checksum::checkdigit_detail::pos,
features::checksum::checkdigit_detail::size
> counter_type;
typename counter_type::type counter = counter_type()();
- std::size_t checksum;
+ size_t checksum;
checksum = compute_checksum<typename features::checksum::processor,
typename features::size_policy>
Modified: sandbox/SOC/2011/checks/boost/checks/checkdigit.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/checkdigit.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/checkdigit.hpp 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -16,17 +16,17 @@
#pragma once
#endif
-#include <cstddef> // std::size_t
+#include <cstddef> // size_t
namespace boost{
namespace checks{
-template <std::size_t checkdigit_pos,
- std::size_t checkdigit_size>
+template <size_t checkdigit_pos,
+ size_t checkdigit_size>
struct checkdigit
{
- static const std::size_t pos = checkdigit_pos;
- static const std::size_t size = checkdigit_size;
+ static const size_t pos = checkdigit_pos;
+ static const size_t size = checkdigit_size;
};
// A checkdigit at the end of the number for reverse traversal.
Modified: sandbox/SOC/2011/checks/boost/checks/checksum.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/checksum.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/checksum.hpp 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -69,24 +69,24 @@
struct no_size_policy
{
- static bool check(std::size_t pos)
+ static bool check(size_t pos)
{
return true;
}
- static bool overflow(std::size_t pos)
+ static bool overflow(size_t pos)
{
return false;
}
};
-template <std::size_t size_expected>
+template <size_t size_expected>
struct enforce_size_policy
{
- static bool check(std::size_t pos)
+ static bool check(size_t pos)
{
return pos < size_expected;
}
- static bool overflow(std::size_t pos)
+ static bool overflow(size_t pos)
{
return pos != size_expected;
}
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 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -16,7 +16,7 @@
#pragma once
#endif
-#include <cstddef> // std::size_t
+#include <cstddef> // size_t
#include <functional>
@@ -25,10 +25,10 @@
struct chartodigit
{
- typedef std::size_t result_type;
+ typedef size_t result_type;
template <typename value_type>
- std::size_t operator()(const value_type &value) const
+ size_t operator()(const value_type &value) const
{
return value - '0';
}
@@ -37,10 +37,10 @@
struct chartodigitx
{
- typedef std::size_t result_type;
+ typedef size_t result_type;
template <typename value_type>
- std::size_t operator()(const value_type &value) const
+ size_t operator()(const value_type &value) const
{
return value <= '9' ? (value - '0') : 10;
}
Modified: sandbox/SOC/2011/checks/boost/checks/detail/sequence_counter.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/detail/sequence_counter.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/detail/sequence_counter.hpp 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -26,10 +26,10 @@
namespace detail
{
-template <std::size_t skip_at, std::size_t size_to_skip>
-struct skipper : public std::unary_function <std::size_t, std::size_t>
+template <size_t skip_at, size_t size_to_skip>
+struct skipper : public std::unary_function <size_t, size_t>
{
- std::size_t operator()(std::size_t value_pos) const
+ size_t operator()(size_t value_pos) const
{
return value_pos + size_to_skip * (value_pos >= skip_at);
}
@@ -37,14 +37,14 @@
struct simple_counter
{
- typedef boost::counting_iterator<std::size_t> type;
+ typedef boost::counting_iterator<size_t> type;
type operator()()
{
return type(0);
}
};
-template <std::size_t skip_at, std::size_t size_to_skip>
+template <size_t skip_at, size_t size_to_skip>
struct skip_counter
{
typedef boost::transform_iterator<skipper<skip_at, size_to_skip>, simple_counter::type> type;
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 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -103,12 +103,12 @@
\returns The check digit. The check digit is in the range [0..9].
*/
template <typename check_range>
-std::size_t compute_ean13(const check_range& x)
+size_t compute_ean13(const check_range& x)
{
return compute_checkdigit<ean13>(x);
}
-std::size_t compute_ean13(const std::string& x)
+size_t compute_ean13(const std::string& x)
{
return compute_checkdigit<ean13>(make_precheck<digit>(x));
}
@@ -150,12 +150,12 @@
\returns The check digit. The check digit is in the range [0..9].
*/
template <typename check_range>
-std::size_t compute_ean8(const check_range& x)
+size_t compute_ean8(const check_range& x)
{
return compute_checkdigit<ean8>(x);
}
-std::size_t compute_ean8(const std::string& x)
+size_t compute_ean8(const std::string& x)
{
return compute_checkdigit<ean8>(make_precheck<digit>(x));
}
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 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -16,7 +16,7 @@
#pragma once
#endif
-#include <cstddef> // std::size_t
+#include <cstddef> // size_t
#include <cctype>
#include <functional>
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 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -74,12 +74,12 @@
\returns The check digit. The check digit is in the range [0..9].
*/
template <typename range>
-std::size_t compute_isbn13 (const range& x)
+size_t compute_isbn13 (const range& x)
{
return compute_checkdigit<isbn13>(x);
}
-std::size_t compute_isbn13 (const std::string& x)
+size_t compute_isbn13 (const std::string& x)
{
return compute_checkdigit<isbn13>(make_precheck<digit>(x));
}
@@ -128,12 +128,12 @@
\returns The check digit. The check digit is in the range [0..9,X].
*/
template <typename range>
-std::size_t compute_isbn10(const range& x)
+size_t compute_isbn10(const range& x)
{
return compute_checkdigit<isbn10>(x);
}
-std::size_t compute_isbn10(const std::string& x)
+size_t compute_isbn10(const std::string& x)
{
return compute_checkdigit<isbn10>(make_precheck<digitx>(x));
}
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 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -42,9 +42,9 @@
{
luhn_processor() {}
- std::size_t operator()(std::size_t checksum, std::size_t value, std::size_t pos)
+ size_t operator()(size_t checksum, size_t value, size_t pos)
{
- std::size_t weighted_value = value << (pos & 1);
+ size_t weighted_value = value << (pos & 1);
return checksum + weighted_value % 10 + weighted_value / 10;
}
};
@@ -109,7 +109,7 @@
\returns The check digit. The check digit is in the range [0..9].
*/
template <size_t size_expected, typename check_range>
-std::size_t compute_luhn(const check_range& check_seq)
+size_t compute_luhn(const check_range& check_seq)
{
return compute_checkdigit<features<luhn, size_expected> >(check_seq);
}
@@ -128,7 +128,7 @@
\returns The check digit. The check digit is in the range [0..9].
*/
template <typename check_range>
-std::size_t compute_luhn (const check_range& check_seq)
+size_t compute_luhn (const check_range& check_seq)
{
return compute_checkdigit<features<luhn> >(check_seq);
}
Modified: sandbox/SOC/2011/checks/boost/checks/modulus10.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/modulus10.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/modulus10.hpp 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -38,7 +38,7 @@
*/
struct mod10_validation
{
- bool operator()(std::size_t checksum)
+ bool operator()(size_t checksum)
{
return !(checksum % 10);
}
@@ -55,7 +55,7 @@
*/
struct mod10_checkdigit
{
- std::size_t operator()(std::size_t checksum)
+ size_t operator()(size_t checksum)
{
return ((10 - checksum % 10) % 10);
}
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 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -47,7 +47,7 @@
*/
struct mod11_validation
{
- bool operator()(std::size_t checksum)
+ bool operator()(size_t checksum)
{
return !(checksum % 11);
}
@@ -64,7 +64,7 @@
*/
struct mod11_checkdigit
{
- std::size_t operator()(std::size_t checksum)
+ size_t operator()(size_t checksum)
{
return ((11 - checksum % 11)% 11);
}
@@ -138,8 +138,8 @@
\returns The check digit. The check digit is in the range [0..9,X].
*/
-template <std::size_t size_expected, typename check_range>
-std::size_t compute_modulus11(const check_range& check_seq)
+template <size_t size_expected, typename check_range>
+size_t compute_modulus11(const check_range& check_seq)
{
return compute_checkdigit<features<mod11,
size_expected> >(check_seq);
@@ -159,7 +159,7 @@
\returns The check digit. The check digit is in the range [0..9,X].
*/
template <typename check_range>
-std::size_t compute_modulus11(const check_range& check_seq)
+size_t compute_modulus11(const check_range& check_seq)
{
return compute_checkdigit<features<mod11> >(check_seq);
}
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 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -45,7 +45,7 @@
*/
struct mod97_validation
{
- bool operator()(std::size_t checksum)
+ bool operator()(size_t checksum)
{
return checksum % 97 == 1;
}
@@ -66,7 +66,7 @@
*/
struct mod97_checkdigit
{
- std::size_t operator()(std::size_t checksum)
+ size_t operator()(size_t checksum)
{
return 98 - (checksum % 97);
}
@@ -82,7 +82,7 @@
{
}
- std::size_t operator()(std::size_t checksum, std::size_t value, std::size_t pos)
+ size_t operator()(size_t checksum, size_t value, size_t pos)
{
if(pos == 0)
weight = 1;
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 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -89,12 +89,12 @@
\returns The check digit. The check digit is in the range [0..9].
*/
template <typename check_range>
-std::size_t compute_upca(const check_range& x)
+size_t compute_upca(const check_range& x)
{
return compute_checkdigit<upca>(x);
}
-std::size_t compute_upca(const std::string& x)
+size_t compute_upca(const std::string& x)
{
return compute_checkdigit<upca>(make_precheck<digit>(x));
}
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 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -45,7 +45,7 @@
*/
struct verhoeff_validation
{
- bool operator()(std::size_t checksum)
+ bool operator()(size_t checksum)
{
return !checksum;
}
@@ -64,7 +64,7 @@
{
static const unsigned char inv[10];
- std::size_t operator()(std::size_t checksum)
+ size_t operator()(size_t checksum)
{
return inv[checksum];
}
@@ -89,7 +89,7 @@
verhoeff_processor() { }
- std::size_t operator()(std::size_t checksum, std::size_t value, std::size_t pos)
+ size_t operator()(size_t checksum, size_t value, size_t pos)
{
return d[checksum][p[pos % 8][value]];
}
@@ -180,7 +180,7 @@
\returns The check digit. The check digit is in the range [0..9].
*/
template <size_t size_expected, typename check_range>
-std::size_t compute_verhoeff(const check_range& check_seq)
+size_t compute_verhoeff(const check_range& check_seq)
{
return compute_checkdigit<features<verhoeff, size_expected> >(check_seq);
}
@@ -199,7 +199,7 @@
\returns The check digit. The check digit is in the range [0..9].
*/
template <typename check_range>
-std::size_t compute_verhoeff(const check_range& check_seq)
+size_t compute_verhoeff(const check_range& check_seq)
{
return compute_checkdigit<features<verhoeff> >(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 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -76,12 +76,12 @@
\returns The check digit. The check digit is in the range [0..9].
*/
template <typename check_range>
-std::size_t compute_visa(const check_range& x)
+size_t compute_visa(const check_range& x)
{
return compute_checkdigit<visa>(x);
}
-std::size_t compute_visa(const std::string& x)
+size_t compute_visa(const std::string& x)
{
return compute_checkdigit<visa>(make_precheck<digit>(x));
}
Modified: sandbox/SOC/2011/checks/boost/checks/weight.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/weight.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/weight.hpp 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -18,7 +18,7 @@
#include <boost/preprocessor/repetition.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
-#include <cstddef> // std::size_t
+#include <cstddef> // size_t
/*! \def BOOST_CHECK_LIMIT_WEIGHTS
\brief The BOOST_CHECK_LIMIT_WEIGHTS macro defines the maximum number of weights accepted by the library.
@@ -37,25 +37,25 @@
\remarks There are BOOST_CHECK_LIMIT_WEIGHTS partial specialisations of this class.
*/
-template <BOOST_PP_ENUM_BINARY_PARAMS(BOOST_CHECK_LIMIT_WEIGHTS, std::size_t weight_value, = 0 BOOST_PP_INTERCEPT) >
+template <BOOST_PP_ENUM_BINARY_PARAMS(BOOST_CHECK_LIMIT_WEIGHTS, size_t weight_value, = 0 BOOST_PP_INTERCEPT) >
struct weight
{
-/*! \fn static int at(std::size_t value_pos)
+/*! \fn static int at(size_t value_pos)
\brief Get the weight at the current value position.
\param value_pos is the position of the current value. (0 <= value_pos < n).
\returns The weight value at the position value_pos.
*/
- static int at(std::size_t value_pos) { return 1; }
+ static int at(size_t value_pos) { return 1; }
};
#define _WEIGHT_factory(z, weight_size ,unused) \
- template<BOOST_PP_ENUM_PARAMS(weight_size , std::size_t weight_value)> \
+ template<BOOST_PP_ENUM_PARAMS(weight_size , size_t weight_value)> \
struct weight<BOOST_PP_ENUM_PARAMS(weight_size, weight_value)> \
{ \
- static std::size_t at(std::size_t value_pos) \
+ static size_t at(size_t value_pos) \
{ \
- static const std::size_t weights[weight_size] = { BOOST_PP_ENUM_PARAMS(weight_size, weight_value) } ; \
+ static const size_t weights[weight_size] = { BOOST_PP_ENUM_PARAMS(weight_size, weight_value) } ; \
return weights[value_pos % weight_size] ; \
} \
};
Modified: sandbox/SOC/2011/checks/boost/checks/weighted_sum.hpp
==============================================================================
--- sandbox/SOC/2011/checks/boost/checks/weighted_sum.hpp (original)
+++ sandbox/SOC/2011/checks/boost/checks/weighted_sum.hpp 2013-01-11 15:48:25 EST (Fri, 11 Jan 2013)
@@ -34,7 +34,7 @@
template <typename weight>
struct weighted_sum
{
- std::size_t operator()(std::size_t checksum, std::size_t value, std::size_t pos)
+ size_t operator()(size_t checksum, size_t value, size_t pos)
{
return checksum + value * weight::at(pos);
}
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