@@ -13,33 +13,24 @@ struct section_tag
13
13
{
14
14
std::string prefix; // example: fund.ts.v2
15
15
std::string name; // example: meta.logical
16
+ bool operator ==(const section_tag&) const = default ;
17
+ auto operator <=>(const section_tag&) const = default ;
16
18
};
17
19
18
20
struct section_num {
19
21
std::string prefix; // example: fund.ts.v2
20
22
std::vector<int > num; // sequence of numbers corresponding to section number
21
23
// in relevant doc, e.g,, 17.5.2.1.4.2
24
+ bool operator ==(const section_num&) const = default ;
25
+ auto operator <=>(const section_num&) const = default ;
22
26
};
23
27
24
28
using section_map = std::map<section_tag, section_num>;
25
29
26
- auto operator < (section_tag const & x, section_tag const & y) noexcept -> bool ;
27
- auto operator == (section_tag const & x, section_tag const & y) noexcept -> bool ;
28
- auto operator != (section_tag const & x, section_tag const & y) noexcept -> bool ;
29
30
auto operator << (std::ostream & os,
30
31
section_tag const & tag) -> std::ostream &; // with square brackets
31
32
std::string as_string (section_tag const & x); // without square brackets
32
33
33
- auto operator < (section_num const & x, section_num const & y) noexcept -> bool ;
34
- // section 'x' sorts before section 'y' if its 'prefix' field lexicographically
35
- // precedes that of 'y', and its 'nun' field lexicographically precedes that
36
- // of 'y' if the prefix fields are equivalent.
37
-
38
- auto operator == (section_num const & x, section_num const & y) noexcept -> bool ;
39
- auto operator != (section_num const & x, section_num const & y) noexcept -> bool ;
40
- // Two 'section_num' objects compare equal if their 'prefix' and 'num' both
41
- // compare equal.
42
-
43
34
auto operator >> (std::istream & is, section_num & sn) -> std::istream &;
44
35
auto operator << (std::ostream & os, section_num const & sn) -> std::ostream &;
45
36
0 commit comments