c# - StructuralComparisons for arrays -
in f#:
[0] = [0] = true
in c# or .net bcl in general:
structuralcomparisons.equals(new int[] { 0 }, new int[] { 0 }) == false
why?
postscript:
the reason thought had "right" equals because turned out true:
var = new { x = 3, y = new { z = -1 } }; var b = new { x = 3, y = new { z = -1 } }; structuralcomparisons.equals(a, b) == true;
that's because you're going down object.equals(obja, objb)
won't able handle kind of comparison.
instead this:
structuralcomparisons.structuralequalitycomparer.equals(..., ...)
Comments
Post a Comment