// compare takes the left and right elements and applies the comparator function to them.
compare takes the left and right elements and applies the comparator function to them.
// compare takes the left and right elements and applies the comparator function to them .
func (e Int32Element) compare(r Element, f func(left, right int32) bool) (bool, error) {
	rE, ok := r.(*Int32Element)
	if !ok {
		return false, fmt.Errorf("cannot cast %v to Int32Element", r)
	}
	if e.IsNil() != rE.IsNil() {
		return false, nil
	}
	lv, lok := e.v.(int32)
	if !lok {
		return false, fmt.Errorf("cannot assert %v is a int32", e.v)
	}
	rv, rok := rE.v.(int32)
	if !rok {
		return false, fmt.Errorf("cannot assert %v is a int32", rE.v)
	}
	return f(lv, rv), nil
}
func ( e Int32Element ) compare ( r Element , f func ( left , right int32 ) bool ) ( bool , error ) { rE , ok := r . ( * Int32Element ) if ! ok { return false , fmt . Errorf ( " " , r ) } if e . IsNil ( ) != rE . IsNil ( ) { return false , nil } lv , lok := e . v . ( int32 ) if ! lok { return false , fmt . Errorf ( " " , e . v ) } rv , rok := rE . v . ( int32 ) if ! rok { return false , fmt . Errorf ( " " , rE . v ) } return f ( lv , rv ) , nil }
compare takes the left and right elements and applies the comparator function to them.
compare takes the left and right elements and applies the comparator function to them .
// When their nil status isn't the same, we can't compare them. // Explicit both nil should be handled elsewhere.