September 15, 2003 Error: need explicit cast for function parameter | ||||
---|---|---|---|---|
| ||||
========================= Windows 2000 Professional Digital Mars C/C++ 8.36 STLport 4.5.3 ========================= I have got a problem with compilation of the following piece of code using Digital Mars C/C++ compiler. There was no problem with this code while using GNU g++ 3.2. What is wrong? ====== C++ code : BEGIN ====== ------ bar.h file : Fragment ------ class Foo { [---omitted---] public : bool foo (const Foo* const) const; [---omitted---] } ----------------------------------- ------ bar.cpp file : Fragment ------ [---omitted---] mem_fun(&Foo::foo); // Line#255 [---omitted---] ------------------------------------- ====== C++ code : END ======== ====== Compilation : BEGIN ====== $ sc -I. -I\dm\stlport\stlport -c bar.cpp mem_fun(&Foo::foo); bar.cpp(255) : Error: need explicit cast for function parameter 1 to get from: bool ( Foo::*member func)(const Foo*const )const to : bool ( Foo::*member func)(const Foo*)const mem_fun(&Foo::foo), ====== Compilation : END ======== ===================================== Alex Vinokur mailto:alexvn@connect.to http://mathforum.org/library/view/10978.html ===================================== |
September 16, 2003 Re: Error: need explicit cast for function parameter | ||||
---|---|---|---|---|
| ||||
Posted in reply to Alex Vinokur | Alex Vinokur schrieb...
> $ sc -I. -I\dm\stlport\stlport -c bar.cpp
> mem_fun(&Foo::foo);
>
> bar.cpp(255) : Error: need explicit cast for function parameter 1 to get
> from: bool ( Foo::*member func)(const Foo*const )const
> to : bool ( Foo::*member func)(const Foo*)const
> mem_fun(&Foo::foo),
DMC still treats func(type t) and func(type t const) as different functions. This is already on Walters to do list.
- Heinz
|
Copyright © 1999-2021 by the D Language Foundation