ConvertToAscendString
Applicability
Product |
Supported or Not |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Header File
#include <graph/operator_reg.h>
Function Usage
A template function. It accepts a template parameter T and converts it to the AscendString type. It is mainly used to convert strings of different types to those of 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 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
String of the AscendString type after conversion.
Constraints
None