[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: URLStream sock; .... if (!sock) ---> ambiguous operator!() --> Sock
From: |
David Sugar |
Subject: |
Re: URLStream sock; .... if (!sock) ---> ambiguous operator!() --> Socket/istream |
Date: |
Sun, 14 Sep 2003 13:15:37 -0400 |
User-agent: |
KMail/1.5 |
The lowercase streams came into existance because the original Common C++ ones
behaved differently in some ways from their std C++ counterparts. Hence,
TCPStream is different in some ways from related things like "fstream" in
it's behavior, where "tcpstream" would presumably be closer to the same
behavior. The main difference is that Common C++ objects throw their own
exception class family and that they do not have a seperate "open" method
since this is normally done in the constructor directly. Should there be a
urlstream?
On Friday 12 September 2003 10:07 am, George Yohng wrote:
> When an URLStream is declared and one would want to check it against being
> valid with operator!, compiler error is issued.
>
> conversion to bool works allright.
>
> URLStream sock;
>
> if (!sock) -----> fails during compilation
>
> if (!(bool)sock) --------> works
>
> One has to add this operator explicitly to URLStream, I guess.
>
> Otherwise, lowercase tcpstream implements this operator, is it that there
> should be lowercase urlstream also?
>
> Thanks,
> George.
>
>
> __________________________________________________________________
> McAfee VirusScan Online from the Netscape Network.
> Comprehensive protection for your entire computer. Get your free trial
> today!
> http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397
>
> Get AOL Instant Messenger 5.1 free of charge. Download Now!
> http://aim.aol.com/aimnew/Aim/register.adp?promo=380455
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp