Commit e03beeb8 authored by Dominik Charousset's avatar Dominik Charousset

Integrate review feedback

parent 381a2bec
......@@ -104,7 +104,7 @@ void parse(parse_state& ps, std::pair<First, Second>& kvp) {
template <class T>
enable_if_tt<is_iterable<T>> parse(parse_state& ps, T& xs) {
using value_type = deconst_kvp_pair_t<typename T::value_type>;
using value_type = deconst_kvp_t<typename T::value_type>;
static constexpr auto is_map_type = is_pair<value_type>::value;
static constexpr auto opening_char = is_map_type ? '{' : '[';
static constexpr auto closing_char = is_map_type ? '}' : ']';
......
......@@ -71,7 +71,7 @@ struct state {
/// Checks whether `i == e`.
bool at_end() const noexcept {
return current() == '\0';
return i == e;
}
/// Skips any whitespaces characters in the input.
......
......@@ -738,17 +738,17 @@ struct always_false : std::false_type {};
/// Utility trait for removing const inside a `map<K, V>::value_type`.
template <class T>
struct deconst_kvp_pair {
struct deconst_kvp {
using type = T;
};
template <class K, class V>
struct deconst_kvp_pair<std::pair<const K, V>> {
struct deconst_kvp<std::pair<const K, V>> {
using type = std::pair<K, V>;
};
template <class T>
using deconst_kvp_pair_t = typename deconst_kvp_pair<T>::type;
using deconst_kvp_t = typename deconst_kvp<T>::type;
/// Utility trait for checking whether T is a `std::pair`.
template <class T>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment