2010/11/28 Jonathan M Davis <jmdavisp...@gmx.com>: > You could theoretically create a template which verified that a struct had the > same functions that an interface required for a class to implement it, but > since > a struct can't implement it, it's just confusing and unnecessary to add a > useless interface into the mix. The struct can't implement it.
I think it's a matter of taste whether it's confusing or not. I'd say it looks better than the is(typeof({}())) combo, and in some ways it's less confusing. Implement! may be a bad name, because structs will of course not implement the interface in the traditional sense. The interface is just the "concept". Torarin