struct BoxView<SelectionValue>: View where SelectionValue: Hashable {
?? Both compile just fine in this case. But sometime I think I have to use where version. What's the different in these two? When to use which? Why Swift don't just allow only one style?
The top one predates the bottom one, but could not express as many things, such as constrained associated types (Something<T: Collection> where T.Element: Hashable). The older syntax was likely kept around simply for backward compatibility. Or possibly because it is shorter where it does work.
Your choice. Some developers use only the second. Others use the first in every situation where it is sufficient, and only resort to the second when necessary.