On 10/16/2016 11:36 AM, Ilya Yaroshenko wrote:
> Hi,
> 
> Extern precompiled Mir GLAS requires additional API changes.
> Reduced example:
> 
> ```d
> struct S(T)
> {
>   size_t len;
>   T ptr;
> }
> 
> auto foo(S!(const(double)*) sl)
> {
> }
> 
> S!(double*) a;
> const S!(double*) b;
> 
> foo(a); // fails
> foo(b); // fails
> 
> ```
> 
> https://issues.dlang.org/show_bug.cgi?id=16616

This issue has been discussed before in context of custom containers and
AFAIK so far no one was able to come up with even theoretical concept of
how it can be possibly addressed. The issue is crazy complicated because
of how D templates work:

struct S (T)
{
    static if (is(typeof(T) == const))
        int a;
    else
        string  a;
}

const S!(int) one;
S!(const int) two;

pragma(msg, typeof(one.a)); // string
pragma(msg, typeof(two.a)); // int

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to