D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4942 - Cannot use std.container.Array with a struct as type parameter
Summary: Cannot use std.container.Array with a struct as type parameter
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P2 major
Assignee: Andrei Alexandrescu
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2010-09-26 00:52 UTC by Risto Saarelma
Modified: 2011-01-22 11:19 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Risto Saarelma 2010-09-26 00:52:15 UTC
Tried to build the following on 64-bit Linux with DMD v2.049:

----
import std.container;
 
struct X {
  int a;
}
 
void main() {
  auto c = Array!X();
}
----

I get this error message:
src/phobos/std/container.d(1485): Error: template instance template 'hasElabo
rateDestructor' is not defined                                                                     
src/phobos/std/container.d(1485): Error: hasElaborateDestructor!(X) is not an
 expression

It looks like hasElaborateDestructor is not defined anywhere in the source tree.
Comment 1 Stephan Dilly 2010-12-28 03:37:41 UTC
i can confirm this does not work under win32 either. what is the use of a container that one cannot store user defined types in ? and where is the missing hasElaborateDestructor template ?
Comment 2 Andrei Alexandrescu 2011-01-22 11:19:55 UTC
Fixed in http://www.dsource.org/projects/phobos/changeset/2364