Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 29, 2007, 9:39:55 PM (18 years ago)
Author:
landauf
Message:

reference → pointer (for better readability)

File:
1 edited

Legend:

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

    r722 r724  
    5353    */
    5454    template <typename T>
    55     static bool ToString(std::string& output, T input)
     55    static bool ToString(std::string* output, T input)
    5656    {
    5757        std::ostringstream oss;
    5858        if (oss << input)
    5959        {
    60             output = oss.str();
     60            (*output) = oss.str();
    6161            return true;
    6262        }
     
    7878    */
    7979    template <typename T>
    80     static bool ToString(std::string& output, T input, const std::string& fallbackString)
     80    static bool ToString(std::string* output, T input, const std::string& fallbackString)
    8181    {
    8282        if (Convert::ToString(output, input))
    8383            return true;
    8484
    85         output = fallbackString;
     85        (*output) = fallbackString;
    8686        return false;
    8787    }
     
    9999    */
    100100    template <typename T>
    101     static bool FromString(T& output, const std::string& input)
     101    static bool FromString(T* output, const std::string& input)
    102102    {
    103103        std::istringstream iss(input);
    104         if (iss >> output)
     104        if (iss >> (*output))
    105105            return true;
    106106
     
    121121    */
    122122    template <typename T>
    123     static bool FromString(T& output, const std::string& input, T fallbackValue)
     123    static bool FromString(T* output, const std::string& input, T fallbackValue)
    124124    {
    125125        if (Convert::FromString(output, input))
    126126            return true;
    127127
    128         output = fallbackValue;
     128        (*output) = fallbackValue;
    129129        return false;
    130130    }
Note: See TracChangeset for help on using the changeset viewer.