Update ssp.hpp to handle issue fixed in the previous commit

This commit is contained in:
ado 2023-07-25 11:13:32 +02:00
parent 8b928de086
commit 103ff33f21
2 changed files with 12 additions and 8 deletions

View File

@ -109,10 +109,10 @@ struct get_matcher<Matcher, T, Ts...> {
struct is_matcher : is_instance_of_matcher<U, Matcher> {}; struct is_matcher : is_instance_of_matcher<U, Matcher> {};
static_assert(count_v<is_matcher, T, Ts...> <= 1, static_assert(count_v<is_matcher, T, Ts...> <= 1,
"the same matcher is cannot" "the same matcher cannot"
"be defined multiple times"); "be defined multiple times");
using type = std::conditional_t<is_matcher<T>::value, T, using type = std::conditional_t<is_matcher<T>::value, T,
typename get_matcher<Matcher, Ts...>::type>; typename get_matcher<Matcher, Ts...>::type>;
}; };
template <template <char...> class Matcher> template <template <char...> class Matcher>
@ -150,7 +150,7 @@ struct get_multiline;
template <typename T, typename... Ts> template <typename T, typename... Ts>
struct get_multiline<T, Ts...> { struct get_multiline<T, Ts...> {
using type = std::conditional_t<is_instance_of_multiline<T>::value, T, using type = std::conditional_t<is_instance_of_multiline<T>::value, T,
typename get_multiline<Ts...>::type>; typename get_multiline<Ts...>::type>;
}; };
template <> template <>

14
ssp.hpp
View File

@ -17,6 +17,7 @@
#include <vector> #include <vector>
#define SSP_DISABLE_FAST_FLOAT #define SSP_DISABLE_FAST_FLOAT
namespace ss { namespace ss {
//////////////// ////////////////
@ -394,6 +395,7 @@ T to_object(U&& data) {
} /* trait */ } /* trait */
namespace ss { namespace ss {
//////////////// ////////////////
@ -1380,6 +1382,7 @@ public:
} /* ss */ } /* ss */
#ifndef SSP_DISABLE_FAST_FLOAT #ifndef SSP_DISABLE_FAST_FLOAT
#else #else
#endif #endif
@ -1909,7 +1912,7 @@ private:
//////////////// ////////////////
const split_data& resplit(line_ptr_type new_line, ssize_t new_size, const split_data& resplit(line_ptr_type new_line, ssize_t new_size,
const std::string& delim = default_delimiter) { const std::string& delim) {
return splitter_.resplit(new_line, new_size, delim); return splitter_.resplit(new_line, new_size, delim);
} }
@ -2198,6 +2201,7 @@ private:
} /* ss */ } /* ss */
namespace ss { namespace ss {
template <typename... Matchers> template <typename... Matchers>
@ -2339,9 +2343,8 @@ public:
template <bool get_object, typename T, typename... Ts> template <bool get_object, typename T, typename... Ts>
struct iterable { struct iterable {
struct iterator { struct iterator {
using value = using value = std::conditional_t<get_object, T,
std::conditional_t<get_object, T, no_void_validator_tup_t<T, Ts...>>;
no_void_validator_tup_t<T, Ts...>>;
iterator() : parser_{nullptr} { iterator() : parser_{nullptr} {
} }
@ -2812,7 +2815,8 @@ private:
} }
} }
next_line_converter_.resplit(next_line_buffer_, size); next_line_converter_.resplit(next_line_buffer_, size,
delim_);
} }
} }