H. S. Teoh:
void opApply(int delegate(ref uint n) cb) const {
Use const ref:
void opApply(int delegate(const ref uint n) cb) const {
Bye,
bearophile
On Fri, Jan 13, 2012 at 07:36:40AM -0500, bearophile wrote:
H. S. Teoh:
void opApply(int delegate(ref uint n) cb) const {
Use const ref:
void opApply(int delegate(const ref uint n) cb) const {
[...]
Thanks a lot! That works like a charm!
T
--
Let's not fight disease by
On Thu, 12 Jan 2012 22:49:49 -0500, H. S. Teoh hst...@quickfur.ath.cx
wrote:
Hi all,
I'm experimenting with overloading foreach() with opApply, and I found
that this code doesn't compile:
class C {
void opApply(int delegate(uint n) cb) const {
Hi all,
I'm experimenting with overloading foreach() with opApply, and I found
that this code doesn't compile:
class C {
void opApply(int delegate(uint n) cb) const {
...
}
}
unittest {
auto c = new