Changeset 1551
- Timestamp:
- 05/24/10 04:27:16 (15 years ago)
- Files:
-
- trunk/docsrc/changelog.dd (modified) (1 diff)
- trunk/phobos/std/traits.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/docsrc/changelog.dd
r1550 r1551 13 13 $(BUGSFIXED 14 14 $(LI $(BUGZILLA 2738): Rebindable should work for interfaces.) 15 15 $(LI $(BUGZILLA 2835): std.socket.TcpSocket doesn't actually connect) 16 16 $(LI $(BUGZILLA 3088): std.xml.check() fails on xml comments) 17 17 $(LI $(BUGZILLA 3200): std.xml doesn't follow spec for Tag.text) 18 18 $(LI $(BUGZILLA 3873): std.range.repeat should have popBack defined) 19 19 $(LI $(BUGZILLA 3880): std.regex functions with const/immutable Regex object) 20 20 $(LI $(BUGZILLA 4109): writeln doesn't work with empty static array) 21 21 $(LI $(BUGZILLA 4202): Changset 1517 doesn't compile) 22 22 $(LI $(BUGZILLA 4228): std.array.replace contains 2 bugs) 23 $(LI $(BUGZILLA 4219): hasAliasing does not care about immutable) 23 24 ) 24 25 ) 25 26 26 27 <div id=version> 27 28 $(UL 28 29 $(NEW 047) 29 30 $(NEW 046) 30 31 $(NEW 045) 31 32 $(NEW 044) 32 33 $(NEW 043) trunk/phobos/std/traits.d
r1541 r1551 894 894 { 895 895 enum hasObjects = hasObjects!(U, T[1 .. $]); 896 896 } 897 897 else static if (is(T[0] == struct)) 898 898 { 899 899 enum hasObjects = hasObjects!( 900 900 RepresentationTypeTuple!(T[0]), T[1 .. $]); 901 901 } 902 902 else 903 903 { 904 enum hasObjects = is(T[0] == class) || hasObjects!(T[1 .. $]); 904 enum hasObjects = (is(T[0] == class) && !is(T[0] == immutable)) || 905 hasObjects!(T[1 .. $]); 905 906 } 906 907 } 907 908 908 909 /** 909 910 Returns $(D true) if and only if $(D T)'s representation includes at 910 911 least one of the following: $(OL $(LI a raw pointer $(D U*) and $(D U) 911 912 is not immutable;) $(LI an array $(D U[]) and $(D U) is not 912 913 immutable;) $(LI a reference to a class type $(D C) and $(D C) is not 913 914 immutable.)) 914 915 */ … … 917 918 { 918 919 enum hasAliasing = hasRawAliasing!(T) || hasObjects!(T); 919 920 } 920 921 921 922 unittest 922 923 { 923 924 struct S1 { int a; Object b; } 924 925 static assert(hasAliasing!(S1)); 925 926 struct S2 { string a; } 926 927 static assert(!hasAliasing!(S2)); 928 struct S3 { int a; immutable Object b; } 929 static assert(!hasAliasing!(S3)); 927 930 } 928 931 929 932 //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::// 930 933 // Classes and Interfaces 931 934 //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::// 932 935 933 936 /*** 934 937 * Get a $(D_PARAM TypeTuple) of the base class and base interfaces of 935 938 * this class or interface. $(D_PARAM BaseTypeTuple!(Object)) returns 936 939 * the empty type tuple.
