mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
fix iterator parameter
This commit is contained in:
parent
6e8b5ea395
commit
802f2fbaed
111 changed files with 607 additions and 633 deletions
|
@ -22,8 +22,8 @@ namespace sprout {
|
|||
template<typename RandomAccessIterator, typename T>
|
||||
inline SPROUT_CONSTEXPR RandomAccessIterator
|
||||
find_character_set_impl_ra(
|
||||
RandomAccessIterator first, RandomAccessIterator last, T const& value,
|
||||
typename std::iterator_traits<RandomAccessIterator>::difference_type pivot, RandomAccessIterator found
|
||||
RandomAccessIterator const& first, RandomAccessIterator const& last, T const& value,
|
||||
typename std::iterator_traits<RandomAccessIterator>::difference_type pivot, RandomAccessIterator const& found
|
||||
)
|
||||
{
|
||||
return found != first ? found
|
||||
|
@ -48,7 +48,7 @@ namespace sprout {
|
|||
RandomAccessIterator
|
||||
>::type
|
||||
find_character_set(
|
||||
RandomAccessIterator first, RandomAccessIterator last, T const& value,
|
||||
RandomAccessIterator const& first, RandomAccessIterator const& last, T const& value,
|
||||
std::random_access_iterator_tag*
|
||||
)
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR sprout::pair<BidirectionalIterator, bool>
|
||||
find_character_set_impl_1(
|
||||
sprout::pair<BidirectionalIterator, bool> const& current,
|
||||
BidirectionalIterator last, T const& value, typename std::iterator_traits<BidirectionalIterator>::difference_type n
|
||||
BidirectionalIterator const& last, T const& value, typename std::iterator_traits<BidirectionalIterator>::difference_type n
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<BidirectionalIterator, bool> type;
|
||||
|
@ -83,7 +83,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR sprout::pair<BidirectionalIterator, bool>
|
||||
find_character_set_impl(
|
||||
sprout::pair<BidirectionalIterator, bool> const& current,
|
||||
BidirectionalIterator last, T const& value, typename std::iterator_traits<BidirectionalIterator>::difference_type n
|
||||
BidirectionalIterator const& last, T const& value, typename std::iterator_traits<BidirectionalIterator>::difference_type n
|
||||
)
|
||||
{
|
||||
return current.second || current.first == last ? current
|
||||
|
@ -99,7 +99,7 @@ namespace sprout {
|
|||
template<typename BidirectionalIterator, typename T>
|
||||
inline SPROUT_CONSTEXPR BidirectionalIterator
|
||||
find_character_set(
|
||||
BidirectionalIterator first, BidirectionalIterator last, T const& value,
|
||||
BidirectionalIterator const& first, BidirectionalIterator const& last, T const& value,
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
|
@ -109,7 +109,7 @@ namespace sprout {
|
|||
|
||||
template<typename BidirectionalIterator, typename T>
|
||||
inline SPROUT_CONSTEXPR BidirectionalIterator
|
||||
find_character_set(BidirectionalIterator first, BidirectionalIterator last, T const& value) {
|
||||
find_character_set(BidirectionalIterator const& first, BidirectionalIterator const& last, T const& value) {
|
||||
typedef typename std::iterator_traits<BidirectionalIterator>::iterator_category* category;
|
||||
return sprout::weed::detail::find_character_set(first, last, value, category());
|
||||
}
|
||||
|
|
|
@ -35,8 +35,7 @@ namespace sprout {
|
|||
public:
|
||||
template<typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type operator()(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Context const&
|
||||
) const
|
||||
{
|
||||
|
|
|
@ -37,8 +37,7 @@ namespace sprout {
|
|||
public:
|
||||
template<typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type operator()(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Context const&
|
||||
) const
|
||||
{
|
||||
|
|
|
@ -53,8 +53,7 @@ namespace sprout {
|
|||
{}
|
||||
template<typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type operator()(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Context const&
|
||||
) const
|
||||
{
|
||||
|
@ -110,8 +109,7 @@ namespace sprout {
|
|||
{}
|
||||
template<typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type operator()(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Context const&
|
||||
) const
|
||||
{
|
||||
|
@ -151,8 +149,7 @@ namespace sprout {
|
|||
{}
|
||||
template<typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type operator()(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Context const&
|
||||
) const
|
||||
{
|
||||
|
@ -191,8 +188,7 @@ namespace sprout {
|
|||
{}
|
||||
template<typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type operator()(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Context const&
|
||||
) const
|
||||
{
|
||||
|
@ -223,8 +219,7 @@ namespace sprout {
|
|||
public:
|
||||
template<typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type operator()(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Context const&
|
||||
) const
|
||||
{
|
||||
|
|
|
@ -40,8 +40,7 @@ namespace sprout {
|
|||
public: \
|
||||
template<typename Context, typename Iterator> \
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type operator()( \
|
||||
Iterator first, \
|
||||
Iterator last, \
|
||||
Iterator first, Iterator last, \
|
||||
Context const& \
|
||||
) const \
|
||||
{ \
|
||||
|
|
|
@ -66,8 +66,7 @@ namespace sprout {
|
|||
N == limit_digits,
|
||||
typename result<Context, Iterator>::type
|
||||
>::type call_1(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Iterator temp_first,
|
||||
IntType t,
|
||||
std::size_t n,
|
||||
|
@ -79,8 +78,7 @@ namespace sprout {
|
|||
return sprout::tuples::get<1>(res)
|
||||
? n < MaxDigits
|
||||
? call_0<N - 1, Context>(
|
||||
sprout::next(first),
|
||||
last,
|
||||
sprout::next(first), last,
|
||||
temp_first,
|
||||
static_cast<IntType>(t * Radix + sprout::tuples::get<0>(res)),
|
||||
n
|
||||
|
@ -100,8 +98,7 @@ namespace sprout {
|
|||
N != limit_digits,
|
||||
typename result<Context, Iterator>::type
|
||||
>::type call_1(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Iterator temp_first,
|
||||
IntType t,
|
||||
std::size_t n,
|
||||
|
@ -112,8 +109,7 @@ namespace sprout {
|
|||
typedef typename attribute<Context, Iterator>::type attribute_type;
|
||||
return sprout::tuples::get<1>(res)
|
||||
? call_0<N, Context>(
|
||||
sprout::next(first),
|
||||
last,
|
||||
sprout::next(first), last,
|
||||
temp_first,
|
||||
static_cast<IntType>(t * Radix + sprout::tuples::get<0>(res)),
|
||||
n
|
||||
|
@ -125,8 +121,7 @@ namespace sprout {
|
|||
}
|
||||
template<std::size_t N, typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type call_0(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Iterator temp_first,
|
||||
IntType t,
|
||||
std::size_t n
|
||||
|
@ -136,8 +131,7 @@ namespace sprout {
|
|||
typedef typename attribute<Context, Iterator>::type attribute_type;
|
||||
return first != last
|
||||
? call_1<N + 1, Context>(
|
||||
first,
|
||||
last,
|
||||
first, last,
|
||||
temp_first,
|
||||
t,
|
||||
n + 1,
|
||||
|
@ -150,8 +144,7 @@ namespace sprout {
|
|||
}
|
||||
template<typename Context, typename Iterator, typename PResult>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type call_i(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Iterator temp_first,
|
||||
PResult const& res
|
||||
) const
|
||||
|
@ -160,8 +153,7 @@ namespace sprout {
|
|||
typedef typename attribute<Context, Iterator>::type attribute_type;
|
||||
return sprout::tuples::get<1>(res)
|
||||
? call_0<1, Context>(
|
||||
sprout::next(first),
|
||||
last,
|
||||
sprout::next(first), last,
|
||||
temp_first,
|
||||
sprout::tuples::get<0>(res),
|
||||
1
|
||||
|
@ -171,8 +163,7 @@ namespace sprout {
|
|||
}
|
||||
template<typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type call(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Iterator temp_first,
|
||||
int sign = 0
|
||||
) const
|
||||
|
@ -182,8 +173,7 @@ namespace sprout {
|
|||
return first != last
|
||||
? make_result<Context, Iterator>(
|
||||
call_i<Context>(
|
||||
first,
|
||||
last,
|
||||
first, last,
|
||||
temp_first,
|
||||
sprout::weed::detail::from_ndigit<Radix, IntType>(*first)
|
||||
),
|
||||
|
@ -195,8 +185,7 @@ namespace sprout {
|
|||
public:
|
||||
template<typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type operator()(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Context const&
|
||||
) const
|
||||
{
|
||||
|
@ -206,21 +195,18 @@ namespace sprout {
|
|||
return first != last
|
||||
? *first == SPROUT_CHAR_LITERAL('+', elem_type)
|
||||
? call<Context>(
|
||||
sprout::next(first),
|
||||
last,
|
||||
sprout::next(first), last,
|
||||
first,
|
||||
1
|
||||
)
|
||||
: *first == SPROUT_CHAR_LITERAL('-', elem_type)
|
||||
? call<Context>(
|
||||
sprout::next(first),
|
||||
last,
|
||||
sprout::next(first), last,
|
||||
first,
|
||||
-1
|
||||
)
|
||||
: call<Context>(
|
||||
first,
|
||||
last,
|
||||
first, last,
|
||||
first
|
||||
)
|
||||
: result_type(false, first, attribute_type())
|
||||
|
|
|
@ -65,8 +65,7 @@ namespace sprout {
|
|||
N == limit_digits,
|
||||
typename result<Context, Iterator>::type
|
||||
>::type call_1(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Iterator temp_first,
|
||||
UIntType t,
|
||||
std::size_t n,
|
||||
|
@ -78,8 +77,7 @@ namespace sprout {
|
|||
return sprout::tuples::get<1>(res)
|
||||
? n < MaxDigits
|
||||
? call_0<N - 1, Context>(
|
||||
sprout::next(first),
|
||||
last,
|
||||
sprout::next(first), last,
|
||||
temp_first,
|
||||
static_cast<UIntType>(t * Radix + sprout::tuples::get<0>(res)),
|
||||
n
|
||||
|
@ -99,8 +97,7 @@ namespace sprout {
|
|||
N != limit_digits,
|
||||
typename result<Context, Iterator>::type
|
||||
>::type call_1(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Iterator temp_first,
|
||||
UIntType t,
|
||||
std::size_t n,
|
||||
|
@ -111,8 +108,7 @@ namespace sprout {
|
|||
typedef typename attribute<Context, Iterator>::type attribute_type;
|
||||
return sprout::tuples::get<1>(res)
|
||||
? call_0<N, Context>(
|
||||
sprout::next(first),
|
||||
last,
|
||||
sprout::next(first), last,
|
||||
temp_first,
|
||||
static_cast<UIntType>(t * Radix + sprout::tuples::get<0>(res)),
|
||||
n
|
||||
|
@ -124,8 +120,7 @@ namespace sprout {
|
|||
}
|
||||
template<std::size_t N, typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type call_0(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Iterator temp_first,
|
||||
UIntType t,
|
||||
std::size_t n
|
||||
|
@ -135,8 +130,7 @@ namespace sprout {
|
|||
typedef typename attribute<Context, Iterator>::type attribute_type;
|
||||
return first != last
|
||||
? call_1<N + 1, Context>(
|
||||
first,
|
||||
last,
|
||||
first, last,
|
||||
temp_first,
|
||||
t,
|
||||
n + 1,
|
||||
|
@ -149,8 +143,7 @@ namespace sprout {
|
|||
}
|
||||
template<typename Context, typename Iterator, typename PResult>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type call_i(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Iterator temp_first,
|
||||
PResult const& res
|
||||
) const
|
||||
|
@ -159,8 +152,7 @@ namespace sprout {
|
|||
typedef typename attribute<Context, Iterator>::type attribute_type;
|
||||
return sprout::tuples::get<1>(res)
|
||||
? call_0<1, Context>(
|
||||
sprout::next(first),
|
||||
last,
|
||||
sprout::next(first), last,
|
||||
temp_first,
|
||||
sprout::tuples::get<0>(res),
|
||||
1
|
||||
|
@ -170,14 +162,12 @@ namespace sprout {
|
|||
}
|
||||
template<typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type call(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Iterator temp_first
|
||||
) const
|
||||
{
|
||||
return call_i<Context>(
|
||||
first,
|
||||
last,
|
||||
first, last,
|
||||
temp_first,
|
||||
sprout::weed::detail::from_ndigit<Radix, UIntType>(*first)
|
||||
);
|
||||
|
@ -185,8 +175,7 @@ namespace sprout {
|
|||
public:
|
||||
template<typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type operator()(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Context const&
|
||||
) const
|
||||
{
|
||||
|
@ -194,8 +183,7 @@ namespace sprout {
|
|||
typedef typename attribute<Context, Iterator>::type attribute_type;
|
||||
return first != last
|
||||
? call<Context>(
|
||||
first,
|
||||
last,
|
||||
first, last,
|
||||
first
|
||||
)
|
||||
: result_type(false, first, attribute_type())
|
||||
|
|
|
@ -52,8 +52,7 @@ namespace sprout {
|
|||
{}
|
||||
template<typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type operator()(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Context const&
|
||||
) const
|
||||
{
|
||||
|
@ -125,8 +124,7 @@ namespace sprout {
|
|||
{}
|
||||
template<typename Context, typename Iterator>
|
||||
SPROUT_CONSTEXPR typename result<Context, Iterator>::type operator()(
|
||||
Iterator first,
|
||||
Iterator last,
|
||||
Iterator first, Iterator last,
|
||||
Context const&
|
||||
) const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue