www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - __traits(getOverloads, Type, member) order of elements in tuple.

reply Alexandru Ermicioi <alexandru.ermicioi gmail.com> writes:
Good day.

In current implementation of dmd/ldc/gdc, does this trait 
guarantee, that the order of elements returned in tuple, is same, 
in several calls of it on same Type and member?

Also, is guaranteed that in future versions of dmd, the order of 
elements won't change?
Aug 22 2016
parent Lodovico Giaretta <lodovico giaretart.net> writes:
On Monday, 22 August 2016 at 12:14:41 UTC, Alexandru Ermicioi 
wrote:
 Good day.

 In current implementation of dmd/ldc/gdc, does this trait 
 guarantee, that the order of elements returned in tuple, is 
 same, in several calls of it on same Type and member?

 Also, is guaranteed that in future versions of dmd, the order 
 of elements won't change?
The official spec [1] does not state anything about this, but for other similar traits it says that the order is not defined and should not be relied upon, so I'm inclined to think that getOverloads works that way too. Definitely worth an enhancement request, to document this thing. [1] https://dlang.org/spec/traits.html
Aug 22 2016