|
16 | 16 | #include <ostream>
|
17 | 17 | #include <sstream>
|
18 | 18 | #include <type_traits>
|
| 19 | +#include <utility> |
19 | 20 |
|
20 | 21 | namespace torch {
|
21 | 22 | namespace jit {
|
@@ -239,7 +240,7 @@ struct TORCH_API OptionalType : public UnionType {
|
239 | 240 |
|
240 | 241 | std::string annotation_str_impl(TypePrinter printer = nullptr) const override {
|
241 | 242 | std::stringstream ss;
|
242 |
| - ss << "Optional[" << getElementType()->annotation_str(printer) << "]"; |
| 243 | + ss << "Optional[" << getElementType()->annotation_str(std::move(printer)) << "]"; |
243 | 244 | return ss.str();
|
244 | 245 | }
|
245 | 246 | };
|
@@ -906,7 +907,7 @@ struct TORCH_API ListType
|
906 | 907 |
|
907 | 908 | std::string annotation_str_impl(TypePrinter printer = nullptr) const override {
|
908 | 909 | std::stringstream ss;
|
909 |
| - ss << "List[" << getElementType()->annotation_str(printer) << "]"; |
| 910 | + ss << "List[" << getElementType()->annotation_str(std::move(printer)) << "]"; |
910 | 911 | return ss.str();
|
911 | 912 | }
|
912 | 913 | };
|
@@ -1001,7 +1002,7 @@ struct TORCH_API DictType : public SharedType {
|
1001 | 1002 | std::string annotation_str_impl(TypePrinter printer = nullptr) const override {
|
1002 | 1003 | std::stringstream ss;
|
1003 | 1004 | ss << "Dict[" << getKeyType()->annotation_str(printer) << ", "
|
1004 |
| - << getValueType()->annotation_str(printer) << "]"; |
| 1005 | + << getValueType()->annotation_str(std::move(printer)) << "]"; |
1005 | 1006 | return ss.str();
|
1006 | 1007 | }
|
1007 | 1008 |
|
@@ -1046,7 +1047,7 @@ struct TORCH_API FutureType
|
1046 | 1047 |
|
1047 | 1048 | std::string annotation_str_impl(TypePrinter printer = nullptr) const override {
|
1048 | 1049 | std::stringstream ss;
|
1049 |
| - ss << "Future[" << getElementType()->annotation_str(printer) << "]"; |
| 1050 | + ss << "Future[" << getElementType()->annotation_str(std::move(printer)) << "]"; |
1050 | 1051 | return ss.str();
|
1051 | 1052 | }
|
1052 | 1053 | };
|
@@ -1078,7 +1079,7 @@ struct TORCH_API RRefType
|
1078 | 1079 |
|
1079 | 1080 | std::string annotation_str_impl(TypePrinter printer = nullptr) const override {
|
1080 | 1081 | std::stringstream ss;
|
1081 |
| - ss << "RRef[" << getElementType()->annotation_str(printer) << "]"; |
| 1082 | + ss << "RRef[" << getElementType()->annotation_str(std::move(printer)) << "]"; |
1082 | 1083 | return ss.str();
|
1083 | 1084 | }
|
1084 | 1085 | };
|
|
0 commit comments