ConvertToAscendString
Function Usage
A template function to convert strings of different types to those of the AscendString type. Accepts a template parameter T and converts it to the AscendString type.
Prototype
1 | template<typename T> ge::AscendString ConvertToAscendString(T str) |
The following conversions are supported:
- template<> inline ge::AscendString ConvertToAscendString<const char *>(const char *str)
Converts strings of the const char * type using the constructor function of the AscendString class.
- template<> inline ge::AscendString ConvertToAscendString<std::string>(std::string str)
Converts strings of the std::string type to the const char * type first and then converts it again.
- template<> inline ge::AscendString ConvertToAscendString<ge::AscendString>(ge::AscendString str)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
str |
Input |
String to be converted. |
Returns
AscendString after conversion
Troubleshooting
None
Constraints
None
Parent topic: GE Namespace