Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 714 for code/branches/FICN


Ignore:
Timestamp:
Dec 28, 2007, 11:24:35 PM (17 years ago)
Author:
landauf
Message:

I'm not sure if this is better (it's slower, but not a memory leak anymore)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/misc/String2Number.h

    r708 r714  
    5959*/
    6060template <typename T>
    61 const std::string& number2String(T variable)
     61const std::string number2String(T variable)
    6262{
    6363    std::ostringstream oss;
    6464    if (oss << variable)
    65         return *(new std::string(oss.str()));
     65        return std::string(oss.str());
    6666
    67     return *(new std::string(""));
     67    return std::string("");
    6868}
    6969
     
    7878*/
    7979template <typename T>
    80 const std::string& number2String(T variable, const std::string& fallbackString)
     80const std::string number2String(T variable, const std::string& fallbackString)
    8181{
    8282    std::ostringstream oss;
    8383    if (oss << variable)
    84         return *(new std::string(oss.str()));
     84        return std::string(oss.str());
    8585
    8686    return fallbackString;
Note: See TracChangeset for help on using the changeset viewer.