Re: No match for 'operator<<' in '((HttpRequest*
On Jul 13, 10:55 pm, Ian Collins <ian-n...@hotmail.com> wrote:
On 07/14/11 05:17 PM, eric wrote:
-----------------------------------------------------------------------=
-------------------------------------------
If I tried my other design, put opearator<< in class Socket
---------------------------------------------------
// Example 8-3. Using constructors and destructors
#include<iostream>
#include<string>
using namespace std;
class Socket {
public:
Socket(const string& hostname) {}
ostream& operator<<(const std::string&) {}
};
class HttpRequest: public Socket {
Why is HttpRequest derived from Socket?
public:
HttpRequest (const string& hostname) :
sock_(new Socket(hostname)) {}
// ostream& operator<<( Socket*, const std::string& ) {}
This can't be a class member, declare it outside of the class and look
at the return type (hint: where do you get an ostream to return?).
hope that help any advanced c/g++ program to debug my(actually
author's) program
The original code is pretty smelly (and wouldn't compile), but you've
made it worse!
--
Ian Collins
---------------------------------------------------------------------------=
---
why I tried to use : public Socket ?
because I guess , << operator used in
void send(string soapMsg) {sock_ << soapMsg; }
in class HttpRequest
used declaration in class Socket
Need any advanced c/g++ programers suggestion/help and thanks a lot in
advance, Eric
Eric