@@ -123,7 +123,6 @@ enum class NodeKind
123123 throws,
124124 details,
125125 see,
126- related,
127126 precondition,
128127 postcondition
129128};
@@ -651,52 +650,6 @@ tag_invoke(
651650 v = dom::LazyObject (I, domCorpus);
652651}
653652
654- /* * A reference to a related symbol.
655- */
656- struct Related final : Reference
657- {
658- static constexpr auto static_kind = NodeKind::related;
659-
660- Related (std::string string_ = std::string()) noexcept
661- : Reference(std::move(string_), NodeKind::related)
662- {
663- }
664-
665- auto operator <=>(Related const &) const = default ;
666- bool operator ==(Related const &) const noexcept = default ;
667- bool equals (Node const & other) const noexcept override
668- {
669- return Kind == other.Kind &&
670- *this == dynamic_cast <Related const &>(other);
671- }
672- };
673-
674- /* * Map the @ref Related to a @ref dom::Object.
675- */
676- template <class IO >
677- void
678- tag_invoke (
679- dom::LazyObjectMapTag t,
680- IO& io,
681- Related const & I,
682- DomCorpus const * domCorpus)
683- {
684- tag_invoke (t, io, dynamic_cast <Reference const &>(I), domCorpus);
685- }
686-
687- /* * Return the @ref Related as a @ref dom::Value object.
688- */
689- inline
690- void
691- tag_invoke (
692- dom::ValueFromTag,
693- dom::Value& v,
694- Related const & I,
695- DomCorpus const * domCorpus)
696- {
697- v = dom::LazyObject (I, domCorpus);
698- }
699-
700653// ------------------------------------------------
701654//
702655// Block nodes
@@ -1632,8 +1585,6 @@ visit(
16321585 return visitor.template visit <Precondition>();
16331586 case NodeKind::postcondition:
16341587 return visitor.template visit <Postcondition>();
1635- case NodeKind::related:
1636- return visitor.template visit <Related>();
16371588 default :
16381589 MRDOCS_UNREACHABLE ();
16391590 }
@@ -1698,15 +1649,26 @@ struct MRDOCS_DECL
16981649 // / The list of "see also" references.
16991650 std::vector<doc::See> sees;
17001651
1701- // / The list of "related" references.
1702- std::vector<SymbolID> related;
1703-
17041652 // / The list of preconditions.
17051653 std::vector<doc::Precondition> preconditions;
17061654
17071655 // / The list of postconditions.
17081656 std::vector<doc::Postcondition> postconditions;
17091657
1658+ /* * The list of "relates" references.
1659+
1660+ These references are creates with the
1661+ \\relates command.
1662+ */
1663+ std::vector<doc::Reference> relates;
1664+
1665+ /* * The list of "related" references.
1666+
1667+ These references are the inverse of
1668+ the \\relates command.
1669+ */
1670+ std::vector<doc::Reference> related;
1671+
17101672 /* * Constructor.
17111673 */
17121674 MRDOCS_DECL
@@ -1865,6 +1827,9 @@ tag_invoke(
18651827 io.defer (" sees" , [&I, domCorpus] {
18661828 return dom::LazyArray (I.sees , domCorpus);
18671829 });
1830+ io.defer (" relates" , [&I, domCorpus] {
1831+ return dom::LazyArray (I.relates , domCorpus);
1832+ });
18681833 io.defer (" related" , [&I, domCorpus] {
18691834 return dom::LazyArray (I.related , domCorpus);
18701835 });
0 commit comments