Re: using a typedefed variable with library classes

2009-01-17 Thread Charles Hixson
Christopher Wright wrote: Charles Hixson wrote: A) Yes, it works the way that you say. This damages it's utility. B) I'm replying to a question as to how typedef could reasonably be extended. The point of a typedef is to provide additional type safety. This would not exist if you could impl

Re: Guideline for D1/2 compatible code?

2009-01-17 Thread Stewart Gordon
Trass3r wrote: Are there any guidelines for writing code compilable with both dmd 1.x and 2.x? This is to make a library usable by users of either, I presume? I can give a few: - Have a module to define types for such things as pointers/arrays that will be const in D2. - Use version(D_Vers

Re: confused with some_var.dup

2009-01-17 Thread Christopher Wright
Rainer Deyke wrote: Christopher Wright wrote: You can create a COW array struct pretty easily. However, this will be pretty slow in a lot of cases. A built-in COW type does not need to be slow! The compiler can use static analysis to eliminate unnecessary copies, and reference counting can be

Guideline for D1/2 compatible code?

2009-01-17 Thread Trass3r
Are there any guidelines for writing code compilable with both dmd 1.x and 2.x?