|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r68196 - in trunk/boost/spirit/home/qi/numeric: . detail
From: joel_at_[hidden]
Date: 2011-01-16 19:10:18
Author: djowel
Date: 2011-01-16 19:10:17 EST (Sun, 16 Jan 2011)
New Revision: 68196
URL: http://svn.boost.org/trac/boost/changeset/68196
Log:
applying 'inline' patch to numerics
Text files modified:
trunk/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp | 52 ++++++++++++++++++++--------------------
trunk/boost/spirit/home/qi/numeric/numeric_utils.hpp | 8 +++---
2 files changed, 30 insertions(+), 30 deletions(-)
Modified: trunk/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp (original)
+++ trunk/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp 2011-01-16 19:10:17 EST (Sun, 16 Jan 2011)
@@ -60,13 +60,13 @@
struct radix_traits<2>
{
template<typename Char>
- static bool is_valid(Char ch)
+ inline static bool is_valid(Char ch)
{
return ('0' == ch || '1' == ch);
}
template<typename Char>
- static unsigned digit(Char ch)
+ inline static unsigned digit(Char ch)
{
return ch - '0';
}
@@ -84,13 +84,13 @@
struct radix_traits<8>
{
template<typename Char>
- static bool is_valid(Char ch)
+ inline static bool is_valid(Char ch)
{
return ch >= '0' && ch <= '7';
}
template<typename Char>
- static unsigned digit(Char ch)
+ inline static unsigned digit(Char ch)
{
return ch - '0';
}
@@ -108,13 +108,13 @@
struct radix_traits<10>
{
template<typename Char>
- static bool is_valid(Char ch)
+ inline static bool is_valid(Char ch)
{
return ch >= '0' && ch <= '9';
}
template<typename Char>
- static unsigned digit(Char ch)
+ inline static unsigned digit(Char ch)
{
return ch - '0';
}
@@ -132,7 +132,7 @@
struct radix_traits<16>
{
template<typename Char>
- static bool is_valid(Char ch)
+ inline static bool is_valid(Char ch)
{
return (ch >= '0' && ch <= '9')
|| (ch >= 'a' && ch <= 'f')
@@ -140,7 +140,7 @@
}
template<typename Char>
- static unsigned digit(Char ch)
+ inline static unsigned digit(Char ch)
{
if (ch >= '0' && ch <= '9')
return ch - '0';
@@ -164,14 +164,14 @@
struct positive_accumulator
{
template <typename T, typename Char>
- static void add(T& n, Char ch, mpl::false_) // unchecked add
+ inline static void add(T& n, Char ch, mpl::false_) // unchecked add
{
const int digit = radix_traits<Radix>::digit(ch);
n = n * T(Radix) + T(digit);
}
template <typename T, typename Char>
- static bool add(T& n, Char ch, mpl::true_) // checked add
+ inline static bool add(T& n, Char ch, mpl::true_) // checked add
{
// Ensure n *= Radix will not overflow
static T const max = (std::numeric_limits<T>::max)();
@@ -195,14 +195,14 @@
struct negative_accumulator
{
template <typename T, typename Char>
- static void add(T& n, Char ch, mpl::false_) // unchecked subtract
+ inline static void add(T& n, Char ch, mpl::false_) // unchecked subtract
{
const int digit = radix_traits<Radix>::digit(ch);
n = n * T(Radix) - T(digit);
}
template <typename T, typename Char>
- static bool add(T& n, Char ch, mpl::true_) // checked subtract
+ inline static bool add(T& n, Char ch, mpl::true_) // checked subtract
{
// Ensure n *= Radix will not underflow
static T const min = (std::numeric_limits<T>::min)();
@@ -229,7 +229,7 @@
struct int_extractor
{
template <typename Char, typename T>
- static bool
+ inline static bool
call(Char ch, std::size_t count, T& n, mpl::true_)
{
static std::size_t const
@@ -248,7 +248,7 @@
}
template <typename Char, typename T>
- static bool
+ inline static bool
call(Char ch, std::size_t /*count*/, T& n, mpl::false_)
{
// no need to check for overflow
@@ -257,14 +257,14 @@
}
template <typename Char>
- static bool
+ inline static bool
call(Char /*ch*/, std::size_t /*count*/, unused_type, mpl::false_)
{
return true;
}
template <typename Char, typename T>
- static bool
+ inline static bool
call(Char ch, std::size_t count, T& n)
{
return call(ch, count, n
@@ -286,7 +286,7 @@
template <int MaxDigits>
struct check_max_digits
{
- static bool
+ inline static bool
call(std::size_t count)
{
return count < MaxDigits; // bounded
@@ -296,7 +296,7 @@
template <>
struct check_max_digits<-1>
{
- static bool
+ inline static bool
call(std::size_t /*count*/)
{
return true; // unbounded
@@ -329,7 +329,7 @@
# pragma warning(disable: 4127) // conditional expression is constant
#endif
template <typename Iterator, typename Attribute>
- static bool
+ inline static bool
parse_main(
Iterator& first
, Iterator const& last
@@ -381,7 +381,7 @@
#endif
template <typename Iterator>
- static bool
+ inline static bool
parse(
Iterator& first
, Iterator const& last
@@ -392,7 +392,7 @@
}
template <typename Iterator, typename Attribute>
- static bool
+ inline static bool
parse(
Iterator& first
, Iterator const& last
@@ -427,7 +427,7 @@
# pragma warning(disable: 4127) // conditional expression is constant
#endif
template <typename Iterator, typename Attribute>
- static bool
+ inline static bool
parse_main(
Iterator& first
, Iterator const& last
@@ -494,7 +494,7 @@
#endif
template <typename Iterator>
- static bool
+ inline static bool
parse(
Iterator& first
, Iterator const& last
@@ -505,7 +505,7 @@
}
template <typename Iterator, typename Attribute>
- static bool
+ inline static bool
parse(
Iterator& first
, Iterator const& last
@@ -531,7 +531,7 @@
typedef typename make_unsigned<T>::type unsigned_type;
typedef typename make_unsigned<T>::type& unsigned_type_ref;
- static unsigned_type_ref call(T& n)
+ inline static unsigned_type_ref call(T& n)
{
return unsigned_type_ref(n);
}
@@ -540,7 +540,7 @@
template <typename T>
struct cast_unsigned<T, false>
{
- static T& call(T& n)
+ inline static T& call(T& n)
{
return n;
}
Modified: trunk/boost/spirit/home/qi/numeric/numeric_utils.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/numeric/numeric_utils.hpp (original)
+++ trunk/boost/spirit/home/qi/numeric/numeric_utils.hpp 2011-01-16 19:10:17 EST (Sun, 16 Jan 2011)
@@ -52,7 +52,7 @@
not_supported_radix, ());
template <typename Iterator>
- static bool call(Iterator& first, Iterator const& last, T& attr)
+ inline static bool call(Iterator& first, Iterator const& last, T& attr)
{
if (first == last)
return false;
@@ -77,7 +77,7 @@
}
template <typename Iterator, typename Attribute>
- static bool call(Iterator& first, Iterator const& last, Attribute& attr_)
+ inline static bool call(Iterator& first, Iterator const& last, Attribute& attr_)
{
// this case is called when Attribute is not T
T attr;
@@ -102,7 +102,7 @@
not_supported_radix, ());
template <typename Iterator>
- static bool call(Iterator& first, Iterator const& last, T& attr)
+ inline static bool call(Iterator& first, Iterator const& last, T& attr)
{
if (first == last)
return false;
@@ -131,7 +131,7 @@
}
template <typename Iterator, typename Attribute>
- static bool call(Iterator& first, Iterator const& last, Attribute& attr_)
+ inline static bool call(Iterator& first, Iterator const& last, Attribute& attr_)
{
// this case is called when Attribute is not T
T attr;
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