Itinerant magnetism in K2NiF4-type compounds