Guideline for D1/2 compatible code?

Stewart Gordon smjg_1998 at yahoo.com
Sun Jan 18 07:32:19 PST 2009


Trass3r wrote:
<snip>
> I'd like to use "alias char[] string", but dmd complains about conflicts 
> with the builtin "alias invariant(char)[] string"
> 
> Is there any way to redefine string in the scope of the library?

I don't think so.

> I know I could simply use another name or use char[] but if it's 
> possible to redefine it, I'd love to do that.

You're best off not trying to mess with type definitions like this.  It 
would confuse anybody who tries to use your library.  Just use char[] as 
it is - it'll be understood by everyone and keeps things simple.

Stewart.


More information about the Digitalmars-d-learn mailing list