You know what, it is true, I forgot the main(), but, bud, you nailed it!
Ruben, it seems to me that you have a crystal ball or perhaps, somehow, you are
able to access my computer and thus find out exactly what I mean, since I
cannot, sometimes, express myself in the best way possible. If you don’t have a
crystal ball or the ability to access my computer, then, boy, you have a real
talent! I am extremely impress with your performance. Keep up the good work.
Thanks so very much for your help.
From: Ruben Van Boxem
Sent: Sunday, July 5, 2015 12:18 PM
To: [email protected]
Subject: Re: [Mingw-w64-public] unique_ptr and operator<<
2015-07-05 15:40 GMT+02:00 <[email protected]>:
Can anyone, pleeese, tell me why this extractor operator is not causing this
error:
C:\tmp\adfs\main.cpp|20|error: no match for 'operator<<' (operand types are
'std::wostream {aka std::basic_ostream<wchar_t>}' and
'std::unique_ptr<jme::Name>')|
namespace abc{
class MyClass{
private:
int nuestro;
public:
MyClass(){}
virtual MyClass(){}
friend std::wostream& operator<<( std::wostream& os, const abc::Name&
obj );
};//class
}//namespace abc
cpp file
~~~~~~~~
namespace abc{
std::wostream& operator<<(abc::wostream& os, const abc::Name& obj) {
return os << obj.getFirstName() << " "
<< obj.getMiddleName() << " "
<< obj.getLastName();
}//operator<<
} // namespace
You forgot to show main.
In any case, it should look something like this:
#include <memory>
#include <iostream>
#include "myclass.h"
int main()
{
auto myclass = std::make_unique<MyClass>();
std::wcout << *myclass; // my crystal ball guess is you're missing the
asterisk
}
Try to provide a small self contained compilable example (or at least all the
code that produces the error).
And again, stop sending these types of queries to a compiler help mailing list
(gcc-help, and kind of mingw-w64-public... I'm also on Stackoverflow, as are a
lot more people to answer you questions). The place for questions like this is
really more something like stackoverflow.com...
Cheers,
Ruben
---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
--------------------------------------------------------------------------------
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
--------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public