OK. I misunderstood.C does not allow function overloading, so same problem is not there.In C++,// test.cpp#include <stdio.h>void foo(bool) { printf("bool\n"); }void foo(long) { printf("long\n"); }int main(int argc, char **argv){foo(false); // matches bool versionfoo(true); // matches bool versionfoo(0); // ambiguousfoo(1); // ambiguousfoo(2); // ambiguousreturn 0;}
The behavior is same with GCC 4.7.2 (using msys) and dmc.Walter, now I changed my opinion. It seems not correct that being regarded bool type as one of the integer.How about?Kenji Hara2013/4/27 Minas Mina <minas_mina1990@hotmail.co.uk>
On Saturday, 27 April 2013 at 11:41:30 UTC, kenji hara wrote:C doesn't have a bool type, so how can D behave the same?
First, I can guess that why Walter disagree *fixing* this problem.
http://dlang.org/overview.html
Major Design Goals of Dor issue an error.
9. Where D code looks the same as C code, have it either behave the same