[Issue 12576] problem with compile time struct field
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Sun Apr 20 21:33:02 PDT 2014
    
    
  
https://issues.dlang.org/show_bug.cgi?id=12576
--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> ---
Is this a possible workaround for your 'original' code? I'm not sure it's the
actual issue, because the code still fail to compile.
template Replace(string base, T...)
{
    template NextAt(string base, string longest_spec,
            size_t _at0, T...)
    {
    }
    NextAt!(base,"",-1,T) N;
}
struct _CppFunction {
    string funcname;
}
string CppClass1(string name, Clazz)() 
{
    enum _CppFunction cf = {
    };
    enum x = cf.funcname;    // <--- workaround?
    enum mix = Replace!("
        ReturnType Func(Params) {
            return Mangled(args);
        }\n", 
        "Func", /*cf.funcname*/x);   // <--- workaround?
    return mix;
}
enum Mixins = CppClass1!("X", typeof(new class { }));
--
    
    
More information about the Digitalmars-d-bugs
mailing list