Changeset 7720 in orxonox.OLD for trunk/src/lib/util
- Timestamp:
- May 19, 2006, 3:29:21 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/executor/executor_functional.h
r7719 r7720 39 39 template<> float fromString<float>(const std::string& input, float defaultValue) { return isFloat(input, defaultValue); }; 40 40 template<> 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); };41 template<> const std::string& fromString<const std::string&>(const std::string& input, const std::string& defaultValue) { static std::string retVal = isString(input, defaultValue); return retVal; }; 42 42 43 43 template<typename type> type getDefault(const MultiType* const defaultValues, unsigned int i) { return (type)0; }; … … 47 47 template<> float getDefault<float>(const MultiType* const defaultValues, unsigned int i) { return defaultValues[i].getFloat(); }; 48 48 template<> 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(); };49 template<> const std::string& getDefault<const std::string&>(const MultiType* const defaultValues, unsigned int i) { static std::string retVal = defaultValues[i].getString(); return retVal; }; 50 50 51 51 #endif /* __EXECUTOR_FUNCTIONAL_H_ */
Note: See TracChangeset
for help on using the changeset viewer.