When should I implement GetHashCode on an immutable struct?
<p>I've read some questions here, related to <code>GetHashCode</code> correct implementation. What I didn't found is <em>when</em> should I implement this method.</p>

<p>In my specific case, I've build a simple immutable struct :</p>

<pre><code>public struct MyStruct
{
    private readonly Guid m_X;
    private readonly string m_Y;
    private readonly string m_Z;

    public Guid string X
    {
        get { return m_X; }
    }

    public string Y
    {
        get { return m_Y; }
    }

    public string Z
    {
        get { return m_Z; }
    }

    public MyStruct(Guid x, string y, string z)
    {
        if (x == Guid.Empty) throw new ArgumentException("x cannot be equals to Guid.Empty", "x");
        if (string.IsNullOrEmpty(y)) throw new ArgumentException("y cannot be null or empty", "y");
        if (string.IsNullOrEmpty(Z)) throw new ArgumentException("Z cannot be null or empty", "Z");

        this.m_X = x;
        this.m_Y = y;
        this.m_Z = Z;
    }

    public override int GetHashCode()
    {
        var x = 17;

        x = x * 23 + m_X.GetHashCode();
        x = x * 23 + m_Y.GetHashCode();
        x = x * 23 + m_Z.GetHashCode();

        return x;
    }
}
</code></pre>

<p>In this case, I've implemented <code>GetHashCode</code>, but was it mandatory? Isn't the base <code>object.GetHashCode</code> implementation itself handling this scenario?</p>

<p><strong>[Edit]</strong> a bit of background: I have some string to parse and produces. This strings are part of a 3rd party custom query language. The string are always of the form <code>X|Y|Z</code>. I want to avoid developers to play with <code>string.Split</code> and string concatenation by providing this custom struct. Lastly, the struct will contains this two supplementary methods :</p>

<pre><code>    public override string ToString()
    {
        return m_X.ToString() + "|" + m_Y + "|" + m_Z;
    }

    public static MyString Parse(string stringToParse)
    {
         // implementation omitted
    }
</code></pre>
