---
title: "Discussion on \"围绕std::move()谈谈通用引用,类型推导和引用折叠\" | Hashnode"
description: "Discussion on \"围绕std::move()谈谈通用引用,类型推导和引用折叠\". 从std::move()说起\n对于std::move()，既可以接受一个左值，也可以接受一个右值。它的函数定义是这个样子的\ntemplate <typename T>\ntypename remove_reference<T>::type&& move(T&& t) noexcept {\n    return static_cast<typename remove_reference<T>::type&&>(t);\n}\n\n但形参中的T&&并不是是一个右值引用, 如果他是一个右值引用, 那么下面代码..."
url: "https://hashnode.com/posts/std-move-universal-ref-deduced-type-ref-collapsing/62d75ca13060d03288d9f84d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [围绕std::move()谈谈通用引用,类型推导和引用折叠](https://qilingzhao.com/std-move-universal-ref-deduced-type-ref-collapsing?utm_source=hashnode&utm_medium=feed)

从std::move()说起 对于std::move()，既可以接受一个左值，也可以接受一个右值。它的函数定义是这个样子的 template <typename T> typename remove\_reference<T>::type&& move(T&& t) noexcept { return static\_cast<typename remove\_reference<T>::type&&>(t); } 但形参中的T&&并不是是一个右值引用, 如果他是一个右值引用, 那么下面代码...

Jul 20, 2022 · 2 min read · qilingzhao.com  
Read the article

-   [#stdmove](https://hashnode.com/tag/stdmove)
-   [#universal-reference](https://hashnode.com/tag/universal-reference)
-   [#deduced-type](https://hashnode.com/tag/deduced-type)
-   [#reference-collapsing](https://hashnode.com/tag/reference-collapsing)

## Written by

[qilingzhao](https://hashnode.com/@Zhao70)

@Zhao70

  
[View profile](https://hashnode.com/@Zhao70)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
