1

I have a class that overloads the true, false, & and | operators, thus enabling the usage of the && and || operators.

Everything is working as it should, but I'm having a small problem with the XML documentation of this class.

With the help of this answer and that answer I've managed to reference the overloaded operators I've overloaded in the class documentation:

    /// <summary>
    /// ...
    /// The ... class overloads the <see cref="op_True"/>, <see cref="op_False"/>, 
    /// <see cref="op_BitwiseAnd"/> and <see cref="op_BitwiseOr"/> 
    /// operators to make it easy to use in validatios.
    /// The <see cref="op_BitwiseAnd"/> operator returns the first failed operand (or the last operand tested),
    /// and the <see cref="op_BitwiseOr"/> operator returns the first succeesfull operand (or the last operand tested).
    /// Since the <see cref="op_True"/>, <see cref="op_False"/> operators 
    /// are also overloaded, &amp;&amp; and || operators can be used to short-circuit.
    /// </summary>
    public class ...

Official documentation of the <see cref="..."> tag states the following:

The complete set of binary operator function names used is as follows: op_Addition, op_Subtraction, op_Multiply, op_Division, op_Modulus, op_BitwiseAnd, op_BitwiseOr, op_ExclusiveOr, op_LeftShift, op_RightShift, op_Equality, op_Inequality, op_LessThan, op_LessThanOrEqual, op_GreaterThan, and op_GreaterThanOrEqual.

From this documentation (as well as my attempts), There's no way to use the <see cref="..."> for the && and || operators (which are op_LogicalAnd and op_LogicalOr according to this answer).

So is there a better way than writing them manually into the XML (&amp;&amp; and ||) like I already did?

Zohar Peled
  • 79,642
  • 10
  • 69
  • 121
  • Have you tried to use C# operator names from this [answer](https://stackoverflow.com/a/40696928/4728685)? Also, could you please share the small code sample of overridden operators? – Pavel Anikhouski Apr 16 '20 at 08:01
  • @PavelAnikhouski Yes, I have tried that. No Go. I don't think the code is relevant to the question. It's there, it's working, it's passing all the tests - and it's referenced correctly from the documentation. The question is how to reference the operators that can't be overloaded... – Zohar Peled Apr 16 '20 at 08:20

0 Answers0