File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,11 @@ class WareHouseClient {
22
22
void doWarehouseStuff (IClientConnector &clientConnector) {
23
23
JsonRpcClient client (clientConnector, version::v2);
24
24
WareHouseClient appClient (client);
25
- Product p = {" 0xff" , 22.4 , " Product 1" , category::cash_carry};
25
+ Product p;
26
+ p.id = " 0xff" ;
27
+ p.price = 22.4 ;
28
+ p.name = " Product 1" ;
29
+ p.cat = category::cash_carry;
26
30
cout << " Adding product: " << std::boolalpha << appClient.AddProduct (p) << " \n " ;
27
31
28
32
Product p2 = appClient.GetProduct (" 0xff" );
@@ -54,4 +58,4 @@ int main() {
54
58
doWarehouseStuff (httpClient);
55
59
56
60
return 0 ;
57
- }
61
+ }
Original file line number Diff line number Diff line change 4
4
enum class category { order, cash_carry };
5
5
6
6
struct Product {
7
+ public:
8
+ Product () : id(), price(), name(), cat() {}
7
9
std::string id;
8
10
double price;
9
11
std::string name;
You can’t perform that action at this time.
0 commit comments