This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/59048] std::string operator== between std::string and const char* creates unecessary temporary object
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 08 Nov 2013 11:18:16 +0000
- Subject: [Bug libstdc++/59048] std::string operator== between std::string and const char* creates unecessary temporary object
- Auto-submitted: auto-generated
- References: <bug-59048-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59048
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Luca Stoppa from comment #0)
> Template functions
> bool operator==( const char*, const std::string& ) and
> bool operator==( const std::string&, const char* )
> creates unecessary temporary std::string object.
Where?
> It seems like that f()
> and h() are creating a temporary std::string object.
If you look at the code or use a debugger you can see there is no temporary
created, so you'll need to explain why you think that.