Bug 12914 – std.typecons.alignForSize will not accept immutable names argument
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2014-06-13T17:09:00Z
Last change time
2016-02-12T11:10:03Z
Assigned to
nobody
Creator
atrout
Comments
Comment #0 by atrout — 2014-06-13T17:09:34Z
// The following code compiles and works as expected.
import std.typecons;
struct X {}
struct Y {}
alias FieldTypes = TypeTuple!(X,Y);
struct A
{
mixin(alignForSize!(FieldTypes)(["x","y"]));
}
// However, the following fails to compile, giving the message:
// "Error: alignForSize (string[] names...) is not callable using argument types (immutable(char[][]))"
immutable string[] fieldNames = ["x", "y"];
struct B
{
mixin(alignForSize!(FieldTypes)(fieldNames));
}
// I think the problem is due to alignForSize having the incorrect signature:
// string alignForSize(E...)(string[] names...);
// If I'm not mistaken it should be something like:
// pure string alignForSize(E...)(in string[] names...);
// This is my first posted bug and I'm no D guru, so hopefully I'm not simply confused about something. Thanks!