Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7720 in orxonox.OLD for trunk/src/lib/util


Ignore:
Timestamp:
May 19, 2006, 3:29:21 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: strings work too now :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/util/executor/executor_functional.h

    r7719 r7720  
    3939template<> float fromString<float>(const std::string& input, float defaultValue) { return isFloat(input, defaultValue); };
    4040template<> char fromString<char>(const std::string& input, char defaultValue) { return isInt(input, defaultValue); };
    41 template<> const std::string& fromString<const std::string&>(const std::string& input, const std::string& defaultValue) { return isString(input, defaultValue); };
     41template<> const std::string& fromString<const std::string&>(const std::string& input, const std::string& defaultValue) { static std::string retVal = isString(input, defaultValue); return retVal; };
    4242
    4343template<typename type> type getDefault(const MultiType* const defaultValues, unsigned int i) { return (type)0; };
     
    4747template<> float getDefault<float>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getFloat(); };
    4848template<> char getDefault<char>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getChar(); };
    49 template<> std::string getDefault<std::string>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getString(); };
     49template<> const std::string& getDefault<const std::string&>(const MultiType* const defaultValues, unsigned int i) { static std::string retVal = defaultValues[i].getString(); return retVal; };
    5050
    5151#endif /* __EXECUTOR_FUNCTIONAL_H_ */
Note: See TracChangeset for help on using the changeset viewer.