On 01/11/2015 00:57, Jeremy Murphy wrote:
On 30 October 2015 at 05:33, John Maddock
wrote: OK, lets give it a shot and see where it leads.
At the moment it has led me to the question of how to disable division when the coefficients are not a field? And, ideally, provide a useful compiler error message along the way.
I don't expect to actually be able to determine which types are fields (that kind of concept-checking is still a dream) so I'm thinking that I'll just disable it for integral types and rely on documentation for the rest.
We have enough traits to get amazingly close to concepts, however, in this case it's the semantics of say operator / which determine "ring-ness", so yes by all means check for integer types (you may need both is_integral and numeric_limits<>::is_integer to catch them all). John.