On Thursday, 30 August 2012 at 05:26:52 UTC, Philippe Sigaud
wrote:
And with no UFCS ? Did you try s ~= toUpper(field) ~ , ;
Yeah with or without UFCS, the second one fails.
On 2012-08-30 02:13, cal wrote:
Given this code for CTFE on a string array:
enum E {one, two}
enum string[] fields = [EnumMembers!E].to!(string[]);
string print(string[] fields)
{
string s;
foreach(string field; fields)
{
s ~= field.toUpper ~ , ;
}
return s;
}
On 2012-08-30 08:28, Jacob Carlborg wrote:
It works for me. DMD 2.060 Mac OS X.
Oh, it does not. If I replace:
enum string[] fields = [EnumMembers!E].to!(string[]);
With:
enum string[] fields = [one, two];
It works.
--
/Jacob Carlborg
On Thursday, 30 August 2012 at 06:30:50 UTC, Jacob Carlborg wrote:
On 2012-08-30 08:28, Jacob Carlborg wrote:
It works for me. DMD 2.060 Mac OS X.
Oh, it does not. If I replace:
enum string[] fields = [EnumMembers!E].to!(string[]);
With:
enum string[] fields = [one, two];
It works.
On Thursday, 30 August 2012 at 17:38:48 UTC, cal wrote:
On Thursday, 30 August 2012 at 06:30:50 UTC, Jacob Carlborg
wrote:
Replacing string[] with dstring[] for EnumMembers triggers a DMD
bug, so I guess the CTFE interpreter is buggy even in the
string[] case.
Filed
Given this code for CTFE on a string array:
enum E {one, two}
enum string[] fields = [EnumMembers!E].to!(string[]);
string print(string[] fields)
{
string s;
foreach(string field; fields)
{
s ~= field.toUpper ~ , ;
}
return s;
}
pragma(msg, print([one, two]));
On Thu, Aug 30, 2012 at 2:13 AM, cal callumena...@gmail.com wrote:
Given this code for CTFE on a string array:
enum E {one, two}
enum string[] fields = [EnumMembers!E].to!(string[]);
string print(string[] fields)
{
string s;
foreach(string field; fields)
{
s ~=