Hi,
On 09 Nov 2002 09:20:18 +1100
Robert Collins <robertc@squid-cache.org> wrote:
>> Robert Collins <robertc@squid-cache.org> wrote:
>> >> Why use static_cast in squid3 ???
>> [...]
>> >> next it is
>> >> not supported on some compilers
>> >
>> >What compilers don't support it?
>> IBM VAC++ 3.08, gcc prior to 3.0
>
>gcc 2.95 supports it. Can you be more specific about the gcc version
>that doesn't? And is there a newer port of gcc for your OS?
>
>Hmm, IBM are usually quite good, is 3.08 there newest one?
IBM VAC++ 3.08 (made in about 1995) is imho most stable IBM compiler
for OS/2. VAC 3.65 and 4.0 both support it.
The last stable version of EMX (GNU compiler and utils) for OS/2
contain GCC 2.8.1
>> Isn't the static_cast synonym to the type cast ?
>
>No.
>
>> Isn't the C-style cast one of two styles of C++'s cast exression
>>with
>> the same functionality ?
>
>There are many C++ casts:
>static_cast
>dynamic_cast
>const_cast
>reinterpret_cast
>
>the 'C cast' is something like (int *)foo. It's supported in C++, but
>we
>shouldn't use it.
As far as I understood all those are different ways to hell ;-)
>> I hope for that, but it is ipossible, as minimum with sorting
>> functions.
>
>It's trivial to write sorting functions without static casts ( I
>haven't
>actually built this, there may be minor mistakes in my typing):
>
>#include <iostreams>
>
>class Foo {
>public:
> Foo (int seed):aMember(seed){}
> bool operator < (Foo const &rightHandSide) {return aMember <
>rightHandSide.aMember);}
>private:
> int aMember;
>};
>
>int
>main (int argc, char ** argv)
>{
> Foo a(50), b(60);
> if (a < b)
> cout << "A < B" << endl;
> else
> cout << "A >= B" << endl;
>}
>
First, we don't use <iostreams>, I hope.
Second, I meant the qsort funstion and it's argument function.
SY,
Evgeny Kotsuba
Received on Fri Nov 08 2002 - 17:04:48 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:18:39 MST