How can i make that
why is this not allowed? isnt the type restriciton enough?
i want to differentiate between structs and classes so i have a null check where needed and no unnecessary boxing and stuff
public static void Write<T>(this IYamlStream stream, string key, ref T value, DataStyle style = DataStyle.Any)
where T : struct
{
stream.Serialize(ref key);
var emitter = stream.Emitter;
stream.SerializeContext.Serialize(ref emitter, value, style);
}
public static void Write<T>(this IYamlStream stream, string key, ref T value, DataStyle style = DataStyle.Any)
where T : class