This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/59048] std::string operator== between std::string and const char* creates unecessary temporary object


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]