Skip to content

Commit 3a910a6

Browse files
committed
test JSONCONS_VISITOR macros
1 parent 996ad40 commit 3a910a6

File tree

12 files changed

+487
-520
lines changed

12 files changed

+487
-520
lines changed

include/jsoncons/config/jsoncons_config.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ namespace jsoncons {
228228
#define JSONCONS_STRING_VIEW_CONSTANT(CharT, Str) string_view_constant_of_type<CharT>(Str, JSONCONS_WIDEN(Str))
229229

230230

231-
#if defined(JSONCONS_NO_DEPRECATED)
231+
#if !defined(JSONCONS_VISITOR_NO_RETURN)
232232
#define JSONCONS_VISITOR_RETURN_TYPE void
233233
#else
234234
#define JSONCONS_VISITOR_RETURN_TYPE bool
235235
#endif
236236

237-
#if defined(JSONCONS_NO_DEPRECATED)
237+
#if !defined(JSONCONS_VISITOR_NO_RETURN)
238238
#define JSONCONS_VISITOR_RETURN
239239
#else
240240
#define JSONCONS_VISITOR_RETURN return true;

include/jsoncons/decode_traits.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,19 +273,18 @@ namespace jsoncons {
273273
const ser_context&,
274274
std::error_code&) override
275275
{
276-
return visit_half_(typename std::integral_constant<bool, std::is_integral<value_type>::value>::type(), value);
276+
visit_half_(typename std::integral_constant<bool, std::is_integral<value_type>::value>::type(), value);
277+
JSONCONS_VISITOR_RETURN
277278
}
278279

279-
JSONCONS_VISITOR_RETURN_TYPE visit_half_(std::true_type, uint16_t value)
280+
void visit_half_(std::true_type, uint16_t value)
280281
{
281282
v_.push_back(static_cast<value_type>(value));
282-
JSONCONS_VISITOR_RETURN
283283
}
284284

285-
JSONCONS_VISITOR_RETURN_TYPE visit_half_(std::false_type, uint16_t value)
285+
void visit_half_(std::false_type, uint16_t value)
286286
{
287287
v_.push_back(static_cast<value_type>(binary::decode_half(value)));
288-
JSONCONS_VISITOR_RETURN
289288
}
290289

291290
JSONCONS_VISITOR_RETURN_TYPE visit_double(double value,

0 commit comments

Comments
 (0)