@@ -20,19 +20,14 @@ class cbor_options_common
2020{
2121 friend class cbor_options ;
2222
23- int max_nesting_depth_;
23+ int max_nesting_depth_{ 1024 } ;
2424protected:
25+ cbor_options_common () = default ;
26+ cbor_options_common (const cbor_options_common&) = default ;
2527 virtual ~cbor_options_common () = default ;
2628
27- cbor_options_common ()
28- : max_nesting_depth_(1024 )
29- {
30- }
31-
32- cbor_options_common (const cbor_options_common&) = default ;
3329 cbor_options_common& operator =(const cbor_options_common&) = default ;
34- cbor_options_common (cbor_options_common&&) = default ;
35- cbor_options_common& operator =(cbor_options_common&&) = default ;
30+
3631public:
3732 int max_nesting_depth () const
3833 {
@@ -44,24 +39,24 @@ class cbor_decode_options : public virtual cbor_options_common
4439{
4540 friend class cbor_options ;
4641public:
47- cbor_decode_options ()
48- {
49- }
42+ cbor_decode_options () = default ;
43+ cbor_decode_options (const cbor_decode_options& other) = default ;
44+ protected:
45+ cbor_decode_options& operator =(const cbor_decode_options& other) = default ;
5046};
5147
5248class cbor_encode_options : public virtual cbor_options_common
5349{
5450 friend class cbor_options ;
5551
56- bool use_stringref_;
57- bool use_typed_arrays_;
52+ bool use_stringref_{false };
53+ bool use_typed_arrays_{false };
54+ public:
55+ cbor_encode_options () = default ;
56+ cbor_encode_options (const cbor_encode_options& other) = default ;
57+ protected:
58+ cbor_encode_options& operator =(const cbor_encode_options& other) = default ;
5859public:
59- cbor_encode_options ()
60- : use_stringref_(false ),
61- use_typed_arrays_ (false )
62- {
63- }
64-
6560 bool pack_strings () const
6661 {
6762 return use_stringref_;
@@ -80,6 +75,10 @@ class cbor_options final : public cbor_decode_options, public cbor_encode_option
8075 using cbor_encode_options::pack_strings;
8176 using cbor_encode_options::use_typed_arrays;
8277
78+ cbor_options () = default ;
79+ cbor_options (const cbor_options& other) = default ;
80+ cbor_options& operator =(const cbor_options& other) = default ;
81+
8382 cbor_options& max_nesting_depth (int value)
8483 {
8584 this ->max_nesting_depth_ = value;
0 commit comments