www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - associative and commutative properties for functions

reply "Ilya Yaroshenko" <ilyayaroshenko gmail.com> writes:
Rationale:
More CTFE magic with UFCS and operator overlaoding.

Related links:
http://forum.dlang.org/thread/ibhug0$3065$1 digitalmars.com?page=2#post-ibjt80:2418oc:241:40digitalmars.com

Best Regars,
Ilya
Jan 19 2014
parent "bearophile" <bearophileHUGS lycos.com> writes:
Ilya Yaroshenko:

 Rationale:
 More CTFE magic with UFCS and operator overlaoding.

 Related links:
 http://forum.dlang.org/thread/ibhug0$3065$1 digitalmars.com?page=2#post-ibjt80:2418oc:241:40digitalmars.com
associative and commutative are useful and quite nice, but the D compiler is not smart enough to verify that a function has those properties. In general the D design tries to avoid unverifiable attributes. C++ programmers will probably have a way to express (unverified) properties like associative using a new syntax (this page is not very updated): http://en.wikipedia.org/wiki/Concepts_%28C%2B%2B%29#Axioms Bye, bearophile
Jan 19 2014