The problem here is that the argument is a std::string and I was wanting to use it twice in the same concatenated return string. To illustrate:
The function works fine as is, but uncommenting the ternary conditional (if that's even what they're called) screws it up. I'm guessing due to referencing issues. I'm not actually sure even how std::strings really work, but that's not going to be resolved any time soon. The basics are enough for me right now.
string img( string src, string href, string alt, string title = "", string extras = "")
return (string)"<a href=\"" += href += (string)"\"><img src=\"" += src
+= (string)"\" alt=\"" += alt += (string)"\" title=\"" +=
/*( ( title.empty() )?alt:title ) +=*/ (string)"\" " += extras += "/></a>";
I could obviously just copy the string onto another string and then use them both, but I was wondering if anyone knew of a way around this problem. Is there anything I can use?
Thanks in advance