Skip to content

Commit c144e0f

Browse files
committed
reflect_traits_gen_using_allocator_tests
1 parent 3f1d5e0 commit c144e0f

File tree

3 files changed

+63
-62
lines changed

3 files changed

+63
-62
lines changed

include/jsoncons/reflect/reflect_traits_gen.hpp

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,16 @@ struct json_traits_helper
6060
{
6161
using string_view_type = typename Json::string_view_type;
6262

63-
template <typename T>
64-
static conversion_result<T> try_get_member(const Json& j, string_view_type key)
63+
template <typename T,typename Alloc,typename TempAlloc>
64+
static conversion_result<T> try_get_member(const allocator_set<Alloc,TempAlloc>& aset,
65+
const Json& j, string_view_type key)
6566
{
6667
auto it = j.find(key);
6768
if (it == j.object_range().end())
6869
{
6970
return conversion_result<T>(unexpect, conv_errc::missing_required_member);
7071
}
71-
auto result = it->value().template try_as<T>();
72+
auto result = it->value().template try_as<T>(aset);
7273
if (!result)
7374
{
7475
return conversion_result<T>(unexpect, conv_errc::conversion_failed);
@@ -347,7 +348,7 @@ using identity = reflect::identity;
347348

348349
#define JSONCONS_N_MEMBER_AS(Prefix,P2,P3, Member, Count) JSONCONS_N_MEMBER_AS_LAST(Prefix,P2,P3, Member, Count)
349350
#define JSONCONS_N_MEMBER_AS_LAST(Prefix,P2,P3, Member, Count) { \
350-
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(class_instance.Member)>::type>(ajson, json_object_name_members<value_type>::Member(char_type{})); \
351+
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(class_instance.Member)>::type>(aset, ajson, json_object_name_members<value_type>::Member(char_type{})); \
351352
if (result) { \
352353
class_instance.Member = std::move(* result); \
353354
} \
@@ -357,7 +358,7 @@ using identity = reflect::identity;
357358

358359
#define JSONCONS_ALL_MEMBER_AS(Prefix, P2,P3,Member, Count) JSONCONS_ALL_MEMBER_AS_LAST(Prefix,P2,P3, Member, Count)
359360
#define JSONCONS_ALL_MEMBER_AS_LAST(Prefix,P2,P3, Member, Count) { \
360-
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(class_instance.Member)>::type>(ajson, json_object_name_members<value_type>::Member(char_type{})); \
361+
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(class_instance.Member)>::type>(aset, ajson, json_object_name_members<value_type>::Member(char_type{})); \
361362
if (result) { \
362363
class_instance.Member = std::move(* result); \
363364
} \
@@ -428,10 +429,10 @@ namespace reflect { \
428429
return true; \
429430
} \
430431
template <typename Alloc,typename TempAlloc> \
431-
static result_type try_as(const allocator_set<Alloc,TempAlloc>&, const Json& ajson) \
432+
static result_type try_as(const allocator_set<Alloc,TempAlloc>& aset, const Json& ajson) \
432433
{ \
433434
if (!ajson.is_object()) return result_type(jsoncons::unexpect, conv_errc::expected_object, # ClassName); \
434-
value_type class_instance{}; \
435+
value_type class_instance = jsoncons::make_obj_using_allocator<value_type>(aset.get_allocator()); \
435436
if (num_params == num_mandatory_params2) \
436437
{ \
437438
JSONCONS_VARIADIC_FOR_EACH(JSONCONS_ALL_MEMBER_AS,,,, __VA_ARGS__) \
@@ -515,7 +516,7 @@ namespace reflect { \
515516
#define JSONCONS_N_MEMBER_NAME_AS_5(Member, Name, Mode, Match, Into) JSONCONS_N_MEMBER_NAME_AS_7(Member, Name, Mode, Match, Into,)
516517
#define JSONCONS_N_MEMBER_NAME_AS_6(Member, Name, Mode, Match, Into, From) JSONCONS_N_MEMBER_NAME_AS_7(Member, Name, Mode, Match, Into, From)
517518
#define JSONCONS_N_MEMBER_NAME_AS_7(Member, Name, Mode, Match, Into, From) { \
518-
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(Into(class_instance.Member))>::type>(ajson, Name); \
519+
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(Into(class_instance.Member))>::type>(aset, ajson, Name); \
519520
if (result && !Match(From(* result))) {return result_type(jsoncons::unexpect, conv_errc::conversion_failed, class_name);} \
520521
Mode(JSONCONS_N_MEMBER_NAME_AS_8(Member, Name, Mode, Match, Into, From)) }
521522
#define JSONCONS_N_MEMBER_NAME_AS_8(Member, Name, Mode, Match, Into, From) \
@@ -533,7 +534,7 @@ namespace reflect { \
533534
#define JSONCONS_ALL_MEMBER_NAME_AS_5(Member, Name, Mode, Match, Into) JSONCONS_ALL_MEMBER_NAME_AS_7(Member, Name, Mode, Match, Into,)
534535
#define JSONCONS_ALL_MEMBER_NAME_AS_6(Member, Name, Mode, Match, Into, From) JSONCONS_ALL_MEMBER_NAME_AS_7(Member, Name, Mode, Match, Into, From)
535536
#define JSONCONS_ALL_MEMBER_NAME_AS_7(Member, Name, Mode, Match, Into, From) { \
536-
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(Into(class_instance.Member))>::type>(ajson, Name); \
537+
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(Into(class_instance.Member))>::type>(aset, ajson, Name); \
537538
if (result && !Match(From(* result))) {return result_type(jsoncons::unexpect, conv_errc::conversion_failed, class_name);} \
538539
Mode(JSONCONS_ALL_MEMBER_NAME_AS_8(Member, Name, Mode, Match, Into, From)) }
539540
#define JSONCONS_ALL_MEMBER_NAME_AS_8(Member, Name, Mode, Match, Into, From) \
@@ -644,12 +645,12 @@ namespace reflect { \
644645
return true; \
645646
} \
646647
template <typename Alloc,typename TempAlloc> \
647-
static result_type try_as(const allocator_set<Alloc,TempAlloc>&, const Json& ajson) \
648+
static result_type try_as(const allocator_set<Alloc,TempAlloc>& aset, const Json& ajson) \
648649
{ \
649650
const char* class_name = # ClassName; \
650651
std::error_code ec; \
651652
if (!ajson.is_object()) return result_type(jsoncons::unexpect, conv_errc::expected_object, # ClassName); \
652-
value_type class_instance{}; \
653+
value_type class_instance = jsoncons::make_obj_using_allocator<value_type>(aset.get_allocator()); \
653654
if (num_params == num_mandatory_params2) \
654655
{ \
655656
JSONCONS_VARIADIC_FOR_EACH(JSONCONS_ALL_MEMBER_NAME_AS,,,, __VA_ARGS__) \
@@ -723,7 +724,7 @@ namespace reflect { \
723724

724725
#define JSONCONS_CTOR_GETTER_GET(Prefix, P2, P3, Getter, Count) JSONCONS_CTOR_GETTER_GET_LAST(Prefix, P2, P3, Getter, Count)
725726
#define JSONCONS_CTOR_GETTER_GET_LAST(Prefix, P2, P3, Getter, Count) \
726-
auto _r ## Getter = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype((std::declval<value_type*>())->Getter())>::type>(ajson, json_object_name_members<value_type>::Getter(char_type{})); \
727+
auto _r ## Getter = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype((std::declval<value_type*>())->Getter())>::type>(aset, ajson, json_object_name_members<value_type>::Getter(char_type{})); \
727728
if (!_r ## Getter && (num_params-Count) < num_mandatory_params2) {return result_type(jsoncons::unexpect, _r ## Getter.error().code(), json_object_name_members<value_type>::Getter(unexpect));}
728729

729730
#define JSONCONS_CTOR_GETTER_AS(Prefix, P2, P3, Getter, Count) JSONCONS_CTOR_GETTER_AS_LAST(Prefix, P2, P3, Getter, Count),
@@ -790,7 +791,7 @@ namespace reflect { \
790791
return true; \
791792
} \
792793
template <typename Alloc,typename TempAlloc> \
793-
static result_type try_as(const allocator_set<Alloc,TempAlloc>&, const Json& ajson) \
794+
static result_type try_as(const allocator_set<Alloc,TempAlloc>& aset, const Json& ajson) \
794795
{ \
795796
if (!ajson.is_object()) return result_type(jsoncons::unexpect, conv_errc::expected_object, # ClassName); \
796797
JSONCONS_VARIADIC_FOR_EACH(JSONCONS_CTOR_GETTER_GET,ClassName,,, __VA_ARGS__) \
@@ -868,7 +869,7 @@ namespace reflect { \
868869
#define JSONCONS_CTOR_GETTER_NAME_MATCH_4(Getter, Name, Mode, Match) JSONCONS_CTOR_GETTER_NAME_MATCH_6(Getter, Name, Mode, Match, , )
869870
#define JSONCONS_CTOR_GETTER_NAME_MATCH_5(Getter, Name, Mode, Match, Into) JSONCONS_CTOR_GETTER_NAME_MATCH_6(Getter, Name, Mode, Match, Into, )
870871
#define JSONCONS_CTOR_GETTER_NAME_MATCH_6(Getter, Name, Mode, Match, Into, From) { \
871-
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(Into((std::declval<value_type*>())->Getter()))>::type>(ajson, Name); \
872+
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(Into((std::declval<value_type*>())->Getter()))>::type>(aset, ajson, Name); \
872873
if (result && !Match(* result)) {return result_type(jsoncons::unexpect, conv_errc::conversion_failed, class_name);} \
873874
}
874875

@@ -882,7 +883,7 @@ namespace reflect { \
882883
#define JSONCONS_CTOR_GETTER_NAME_GET_5(Getter, Name, Mode, Match, Into) Mode(JSONCONS_CTOR_GETTER_NAME_GET_7(Getter, Name, Mode, Match, Into,))
883884
#define JSONCONS_CTOR_GETTER_NAME_GET_6(Getter, Name, Mode, Match, Into, From) Mode(JSONCONS_CTOR_GETTER_NAME_GET_7(Getter, Name, Mode, Match, Into, From))
884885
#define JSONCONS_CTOR_GETTER_NAME_GET_7(Getter, Name, Mode, Match, Into, From) \
885-
auto _r ## Getter = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(Into((std::declval<value_type*>())->Getter()))>::type>(ajson, Name); \
886+
auto _r ## Getter = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(Into((std::declval<value_type*>())->Getter()))>::type>(aset, ajson, Name); \
886887
if (!_r ## Getter && index < num_mandatory_params2) {return result_type(jsoncons::unexpect, _r ## Getter.error().code(), class_name);} \
887888
if (_r ## Getter && !Match(* _r ## Getter)) {return result_type(jsoncons::unexpect, conv_errc::conversion_failed, class_name);}
888889

@@ -992,7 +993,7 @@ namespace reflect { \
992993
return true; \
993994
} \
994995
template <typename Alloc,typename TempAlloc> \
995-
static result_type try_as(const allocator_set<Alloc,TempAlloc>&, const Json& ajson) \
996+
static result_type try_as(const allocator_set<Alloc,TempAlloc>& aset, const Json& ajson) \
996997
{ \
997998
const char* class_name = # ClassName; \
998999
if (!ajson.is_object()) return result_type(jsoncons::unexpect, conv_errc::expected_object, # ClassName); \
@@ -1114,7 +1115,7 @@ namespace reflect { \
11141115
return it != last; \
11151116
} \
11161117
template <typename Alloc,typename TempAlloc> \
1117-
static result_type try_as(const allocator_set<Alloc,TempAlloc>&, const Json& ajson) \
1118+
static result_type try_as(const allocator_set<Alloc,TempAlloc>& /*aset*/, const Json& ajson) \
11181119
{ \
11191120
if (!is(ajson)) return result_type(jsoncons::unexpect, conv_errc::conversion_failed, # EnumType); \
11201121
auto rs = ajson.try_as_string_view(); \
@@ -1301,7 +1302,7 @@ namespace reflect { \
13011302
return it != last; \
13021303
} \
13031304
template <typename Alloc,typename TempAlloc> \
1304-
static result_type try_as(const allocator_set<Alloc,TempAlloc>&, const Json& ajson) \
1305+
static result_type try_as(const allocator_set<Alloc,TempAlloc>& /*aset*/, const Json& ajson) \
13051306
{ \
13061307
auto rs = ajson.try_as_string_view(); \
13071308
if (!rs) {return result_type(jsoncons::unexpect, conv_errc::conversion_failed, # EnumType);} \
@@ -1435,7 +1436,7 @@ namespace reflect { \
14351436
#define JSONCONS_N_GETTER_SETTER_AS(Prefix, GetPrefix, SetPrefix, Property, Count) JSONCONS_N_GETTER_SETTER_AS_(Prefix, GetPrefix ## Property, SetPrefix ## Property, Property, Count)
14361437
#define JSONCONS_N_GETTER_SETTER_AS_LAST(Prefix, GetPrefix, SetPrefix, Property, Count) JSONCONS_N_GETTER_SETTER_AS_(Prefix, GetPrefix ## Property, SetPrefix ## Property, Property, Count)
14371438
#define JSONCONS_N_GETTER_SETTER_AS_(Prefix, Getter, Setter, Property, Count) { \
1438-
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(class_instance.Getter())>::type>(ajson, json_object_name_members<value_type>::Property(char_type{})); \
1439+
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(class_instance.Getter())>::type>(aset, ajson, json_object_name_members<value_type>::Property(char_type{})); \
14391440
if (result) {class_instance.Setter(std::move(* result));} \
14401441
else if ((num_params-Count) < num_mandatory_params2) {return result_type(jsoncons::unexpect, result.error().code(), # Prefix);} \
14411442
else if (result.error().code() != conv_errc::missing_required_member){return result_type(jsoncons::unexpect, result.error().code(), # Prefix);} \
@@ -1444,7 +1445,7 @@ namespace reflect { \
14441445
#define JSONCONS_ALL_GETTER_SETTER_AS(Prefix, GetPrefix, SetPrefix, Property, Count) JSONCONS_ALL_GETTER_SETTER_AS_(Prefix, GetPrefix ## Property, SetPrefix ## Property, Property, Count)
14451446
#define JSONCONS_ALL_GETTER_SETTER_AS_LAST(Prefix, GetPrefix, SetPrefix, Property, Count) JSONCONS_ALL_GETTER_SETTER_AS_(Prefix, GetPrefix ## Property, SetPrefix ## Property, Property, Count)
14461447
#define JSONCONS_ALL_GETTER_SETTER_AS_(Prefix, Getter, Setter, Property, Count) { \
1447-
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(class_instance.Getter())>::type>(ajson, json_object_name_members<value_type>::Property(char_type{})); \
1448+
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(class_instance.Getter())>::type>(aset, ajson, json_object_name_members<value_type>::Property(char_type{})); \
14481449
if (!result) {return result_type(jsoncons::unexpect, result.error().code(), # Prefix ": " # Property);} \
14491450
class_instance.Setter(std::move(* result)); \
14501451
}
@@ -1514,10 +1515,10 @@ namespace reflect { \
15141515
return true; \
15151516
} \
15161517
template <typename Alloc,typename TempAlloc> \
1517-
static result_type try_as(const allocator_set<Alloc,TempAlloc>&, const Json& ajson) \
1518+
static result_type try_as(const allocator_set<Alloc,TempAlloc>& aset, const Json& ajson) \
15181519
{ \
15191520
if (!ajson.is_object()) return result_type(jsoncons::unexpect, conv_errc::expected_object, # ClassName); \
1520-
value_type class_instance{}; \
1521+
value_type class_instance = jsoncons::make_obj_using_allocator<value_type>(aset.get_allocator()); \
15211522
if (num_params == num_mandatory_params2) \
15221523
{ \
15231524
JSONCONS_VARIADIC_FOR_EACH(JSONCONS_ALL_GETTER_SETTER_AS,ClassName,GetPrefix,SetPrefix, __VA_ARGS__) \
@@ -1599,7 +1600,7 @@ namespace reflect { \
15991600
#define JSONCONS_N_GETTER_SETTER_NAME_AS_5(Getter, Setter, Name, Mode, Match) JSONCONS_N_GETTER_SETTER_NAME_AS_7(Getter, Setter, Name, Mode, Match, , )
16001601
#define JSONCONS_N_GETTER_SETTER_NAME_AS_6(Getter, Setter, Name, Mode, Match, Into) JSONCONS_N_GETTER_SETTER_NAME_AS_7(Getter, Setter, Name, Mode, Match, Into, )
16011602
#define JSONCONS_N_GETTER_SETTER_NAME_AS_7(Getter, Setter, Name, Mode, Match, Into, From) { \
1602-
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(Into(class_instance.Getter()))>::type>(ajson, Name); \
1603+
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(Into(class_instance.Getter()))>::type>(aset, ajson, Name); \
16031604
if (result && !Match(From(* result))) {return result_type(jsoncons::unexpect, conv_errc::conversion_failed, class_name);} \
16041605
Mode(JSONCONS_N_GETTER_SETTER_NAME_AS_8(Getter, Setter, Name, Mode, Match, Into, From)) \
16051606
}
@@ -1626,7 +1627,7 @@ namespace reflect { \
16261627
#define JSONCONS_ALL_GETTER_SETTER_NAME_AS_5(Getter, Setter, Name, Mode, Match) JSONCONS_ALL_GETTER_SETTER_NAME_AS_7(Getter, Setter, Name, Mode, Match,,)
16271628
#define JSONCONS_ALL_GETTER_SETTER_NAME_AS_6(Getter, Setter, Name, Mode, Match, Into) JSONCONS_ALL_GETTER_SETTER_NAME_AS_7(Getter, Setter, Name, Mode, Match, Into,)
16281629
#define JSONCONS_ALL_GETTER_SETTER_NAME_AS_7(Getter, Setter, Name, Mode, Match, Into, From) { \
1629-
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(Into(class_instance.Getter()))>::type>(ajson, Name); \
1630+
auto result = json_traits_helper<Json>::template try_get_member<typename std::decay<decltype(Into(class_instance.Getter()))>::type>(aset, ajson, Name); \
16301631
if (result && !Match(From(* result))) {return result_type(jsoncons::unexpect, conv_errc::conversion_failed, class_name);} \
16311632
Mode(JSONCONS_ALL_GETTER_SETTER_NAME_AS_8(Getter, Setter, Name, Mode, Match, Into, From)) \
16321633
}
@@ -1718,12 +1719,12 @@ namespace reflect { \
17181719
return true; \
17191720
} \
17201721
template <typename Alloc,typename TempAlloc> \
1721-
static result_type try_as(const allocator_set<Alloc,TempAlloc>&, const Json& ajson) \
1722+
static result_type try_as(const allocator_set<Alloc,TempAlloc>& aset, const Json& ajson) \
17221723
{ \
17231724
const char* class_name = # ClassName; \
17241725
std::error_code ec; \
17251726
if (!ajson.is_object()) return result_type(jsoncons::unexpect, conv_errc::expected_object, class_name); \
1726-
value_type class_instance{}; \
1727+
value_type class_instance = jsoncons::make_obj_using_allocator<value_type>(aset.get_allocator()); \
17271728
if (num_params == num_mandatory_params2) \
17281729
{ \
17291730
JSONCONS_VARIADIC_FOR_EACH(JSONCONS_ALL_GETTER_SETTER_NAME_AS,,,, __VA_ARGS__) \

test/corelib/src/reflect/reflect_traits_gen_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,10 @@ namespace ns {
430430
// Make json_type_traits specializations friends to give accesses to private members
431431
JSONCONS_TYPE_TRAITS_FRIEND
432432

433+
public:
433434
hiking_reputation()
434435
{
435436
}
436-
public:
437437
hiking_reputation(const std::string& application, const std::vector<hiking_reputon>& reputons)
438438
: application(application), reputons(reputons)
439439
{}

test/corelib/src/reflect/reflect_traits_gen_using_allocator_tests.cpp

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,58 +17,58 @@
1717

1818
using namespace jsoncons;
1919

20+
#if defined(JSONCONS_HAS_STATEFUL_ALLOCATOR) && JSONCONS_HAS_STATEFUL_ALLOCATOR == 1
21+
22+
#include <scoped_allocator>
23+
#include <common/mock_stateful_allocator.hpp>
24+
25+
template <typename T>
26+
using cust_allocator = std::scoped_allocator_adaptor<mock_stateful_allocator<T>>;
27+
2028
namespace {
2129
namespace ns {
2230

31+
template <typename Alloc>
2332
struct book_all_m
2433
{
25-
std::string author;
26-
std::string title;
34+
using allocator_type = Alloc;
35+
36+
using char_allocator_type = typename std::allocator_traits<typename Alloc::inner_allocator_type>:: template rebind_alloc<char>;
37+
using string_type = std::basic_string<char, std::char_traits<char>, char_allocator_type>;
38+
39+
book_all_m(const Alloc alloc)
40+
: author(alloc), title(alloc)
41+
{
42+
}
43+
44+
string_type author;
45+
string_type title;
2746
double price;
2847
};
2948

3049
} // namespace ns
3150
} // namespace
3251

33-
JSONCONS_ALL_MEMBER_TRAITS(ns::book_all_m,author,title,price)
34-
35-
void test_is_json_type_traits_declared(std::true_type)
36-
{
37-
}
52+
JSONCONS_ALL_MEMBER_TRAITS(ns::book_all_m<cust_allocator<char>>,author,title,price)
3853

3954
TEST_CASE("JSONCONS_ALL_MEMBER_TRAITS using allocator tests")
4055
{
41-
std::string an_author = "Haruki Murakami";
42-
std::string a_title = "Kafka on the Shore";
43-
double a_price = 25.17;
44-
45-
ns::book_all_m book{an_author, a_title, a_price};
46-
47-
CHECK(is_json_type_traits_declared<ns::book_all_m>::value);
48-
test_is_json_type_traits_declared(is_json_type_traits_declared<ns::book_all_m>());
49-
5056
SECTION("success")
5157
{
52-
std::string s;
53-
54-
encode_json(book, s);
55-
56-
json j = decode_json<json>(s);
57-
58-
REQUIRE(j.is<ns::book_all_m>() == true);
59-
60-
CHECK(an_author == j["author"].as<std::string>());
61-
CHECK(a_title == j["title"].as<std::string>() );
62-
CHECK(Approx(a_price).epsilon(0.001) == j["price"].as<double>() );
63-
64-
json j2(book);
65-
66-
CHECK(j == j2);
58+
std::string str = R"(
59+
{
60+
"author" : "Haruki Murakami",
61+
"title" : "Kafka on the Shore",
62+
"price" : 25.17
63+
}
64+
)";
6765

68-
ns::book_all_m val = j.as<ns::book_all_m>();
66+
cust_allocator<char> alloc(1);
67+
auto aset = make_alloc_set(alloc);
68+
auto r = decode_json<ns::book_all_m<cust_allocator<char>>>(aset, str);
6969

70-
CHECK(val.author == book.author);
71-
CHECK(val.title == book.title);
72-
CHECK(val.price == Approx(book.price).epsilon(0.001));
70+
//REQUIRE(r);
7371
}
7472
}
73+
74+
#endif

0 commit comments

Comments
 (0)