Skip to content

Commit

Permalink
inline
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Dec 10, 2022
1 parent 240146b commit d581832
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions iguana/json_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,11 +621,10 @@ IGUANA_INLINE void from_json(T &value, const Byte *data, size_t size,
}
}

template <typename It>
IGUANA_INLINE void parse(jvalue &result, It &&it, It &&end);
template <typename It> void parse(jvalue &result, It &&it, It &&end);

template <typename It>
IGUANA_INLINE void parse_array(jarray &result, It &&it, It &&end) {
inline void parse_array(jarray &result, It &&it, It &&end) {
skip_ws(it, end);
match<'['>(it, end);
if (*it == ']') [[unlikely]] {
Expand All @@ -651,7 +650,7 @@ IGUANA_INLINE void parse_array(jarray &result, It &&it, It &&end) {
}

template <typename It>
IGUANA_INLINE void parse_object(jobject &result, It &&it, It &&end) {
inline void parse_object(jobject &result, It &&it, It &&end) {
skip_ws(it, end);
match<'{'>(it, end);
if (*it == '}') [[unlikely]] {
Expand Down Expand Up @@ -685,8 +684,7 @@ IGUANA_INLINE void parse_object(jobject &result, It &&it, It &&end) {
}
}

template <typename It>
IGUANA_INLINE void parse(jvalue &result, It &&it, It &&end) {
template <typename It> inline void parse(jvalue &result, It &&it, It &&end) {
skip_ws(it, end);
switch (*it) {
case 'n':
Expand Down Expand Up @@ -738,8 +736,7 @@ IGUANA_INLINE void parse(jvalue &result, It &&it, It &&end) {
}

template <typename It>
IGUANA_INLINE void parse(jvalue &result, It &&it, It &&end,
std::error_code &ec) {
inline void parse(jvalue &result, It &&it, It &&end, std::error_code &ec) {
try {
parse(result, it, end);
ec = {};
Expand All @@ -750,13 +747,12 @@ IGUANA_INLINE void parse(jvalue &result, It &&it, It &&end,
}

template <typename T, json_view View>
IGUANA_INLINE void parse(T &result, const View &view) {
inline void parse(T &result, const View &view) {
parse(result, std::begin(view), std::end(view));
}

template <typename T, json_view View>
IGUANA_INLINE void parse(T &result, const View &view,
std::error_code &ec) noexcept {
inline void parse(T &result, const View &view, std::error_code &ec) noexcept {
try {
parse(result, view);
ec = {};
Expand Down

0 comments on commit d581832

Please sign in to comment.