Writing a small opengl text printer (vertex based) I have found that the next
lines are "illegal" to dmd (2.031):
invariant float[][][] CHARS =[
[//A
[0,0],
[1/2f,2],
[1,0],
[3/4f,1],
[1/4f,1]
]
];
dmd complains (compiling with dmd -c bug.d):
bug.d
Writing a small opengl text printer (vertex based) I have found that the next
lines are "illegal" to dmd (2.031):
invariant float[][][] CHARS =[
[//A
[0,0],
[1/2f,2],
[1,0],
[3/4f,1],
[1/4f,1]
]
];
dmd complains (compiling with dmd -c bug.d):
bug.d
Daniel Keep wrote:
No; read the code. Before the put, a and b are pointing to the same
span of memory. a.put(5) puts the value 5 into the front (first
element) of the array, then advances the array.
However, put can't "see" b, so it doesn't get updated along with a. The
end result is that b
Jos van Uden wrote:
> Oliver wrote:
>>> The source code for the standard library comes with the compiler.
>>> If you look in std\array.d, you find this around line 279 (reflowed for
>>> readability):
void put(T, E)(ref T[] a, E e) {
assert(a.length);
a[0] = e; a = a[1 .. $]
Oliver wrote:
The source code for the standard library comes with the compiler.
If you look in std\array.d, you find this around line 279 (reflowed for
readability):
void put(T, E)(ref T[] a, E e) {
assert(a.length);
a[0] = e; a = a[1 .. $];
}
Would anybody care to explain what this is
Hello everybody,
New to D, just playing around with it. Not having a C++
background, I need to learn it little by little. So many
things that puzzle me.
Anyway, just now I managed to get the rdmd shell script to work
on my windows machine.
http://www.digitalmars.com/d/2.0/rdmd.html
I downloade