A difference between decltype and auto?
来源:互联网 发布:java语法快速入门 编辑:程序博客网 时间:2024/05/20 18:17
Quote from the Books:
On the other hand, the dereference operator is an example of an expression for which decltype returns a reference. As we've seen, when we dereference a pointer, we get the object to which the pointer points. Moreover, we can assign to that object. Thus, the type deduced by decltype(*p) is int &, not plain int.
Another important difference between decltype and auto is that the deduction done by decltype depends on the form of its given expression. What can be confusing is that enclosing the name of a variable in parentheses affects the type returned by decltype. When we apply decltype to a variable without any parentheses, we get the type of that variable. If we wrap the variable's name in one or more sets of parentheses, the compiler will evaluate the operand as an expression.
............
- A difference between decltype and auto?
- Difference between new A and new A()
- C++ auto and decltype Explained
- C++11 auto and decltype
- What is the difference between a thread and a process?
- What is the difference between a definition and a declaration?
- What's the difference between a thread and a process?
- What’s the difference between a stack and a heap?
- What is the difference between a process and a thread?
- Difference between a SOAP message and a WSDL?
- What's the difference between a URI and a URL?
- Difference between a hibernate transaction and a database transaction
- Difference between a LinkedList and a Binary Search Tree
- The difference between (()) and ().
- difference between "<" and "<<"
- What's the difference between an event and a delegate?
- Understanding the Difference Between an Argument and a Parameter
- What is the difference between an EXE and a DLL?
- 进制转换
- 联合体中不能出现结构体
- USB数据采集系统中DMA数据传输的实现
- WriteBatch-levelDB源码解析
- grep之字符串搜索算法Boyer-Moore由浅入深(比KMP快3-5倍)
- A difference between decltype and auto?
- Oil Deposits (POJ No.1562) DFS
- C++函数调用原理理解
- 2013-12-22 ubuntu下 android emulator 启动错误解决
- 第17周项目22-年龄几何
- Android Volley完全解析(二),使用Volley加载网络图片
- Ubuntu_Apache_MySql_PHP
- pg函数
- oauth2简单原理描述