---
title: operator=接口
description: "- 重载推理请求体对象的运算符“=”，用于序列号类型为uint64_t的请求体对象的赋值操作。"
url: https://www.hiascend.com/document/detail/zh/mindie/latest/mindiellm/llmdev/mindie_llm0129.html
sourcePath: /source/zh/mindie/310/mindiellm/llmdev/mindie_llm0129.html
indexId: f0bfd4a1802b9c4395cb20b256a6f472d796c32ad2bb84cd5e01061659221bb558
---
# operator=接口

#### 接口功能

- 重载推理请求体对象的运算符“=”，用于序列号类型为uint64_t的请求体对象的赋值操作。
- 重载推理请求体对象的运算符“=”，用于序列号类型为string的请求体对象的赋值操作。
- 重载推理请求体对象的运算符“=”，用于将已有的一个请求体对象赋值给一个新的请求体对象。


#### 接口格式

```
InferRequestId &operator = (const uint64_t rhs);
InferRequestId &operator = (const std::string &rhs);
InferRequestId &operator = (const InferRequestId &rhs);
```


#### 接口参数

| 参数 | 是否必选 | 说明 | 取值要求 |
| --- | --- | --- | --- |
| rhs | 必选 | 请求体序列号，唯一标识请求体。 | 合法的uint64\_t数值。 |


| 参数 | 是否必选 | 说明 | 取值要求 |
| --- | --- | --- | --- |
| rhs | 必选 | 请求体序列号，唯一标识请求体。 | 合法的string类型。 |


| 参数 | 是否必选 | 说明 | 取值要求 |
| --- | --- | --- | --- |
| rhs | 必选 | 推理请求体对象。 | 合法的请求InferRequestId对象。 |


#### 使用样例

构造一个请求ID对象，分别调用重载运算符“=”。

```
mindie_llm::InferRequestId runtimeReqId1(0);
uint64_t reqId = 0;
mindie_llm::InferRequestId runtimeReqId2 = reqId ;
mindie_llm::InferRequestId runtimeReqId3 = "Req";
mindie_llm::InferRequestId runtimeReqId4 = runtimeReqId1;
```


#### 返回值

InferRequestId对象。
