In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to use the decltype modifier of Clippers 11". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Function introduction
In the case of initialization code, you can use auto to automatically determine the type of variable. There is another case where we want the type of variable to be inferred from an expression other than the initialization code.
Suppose you have the following structure:
Struct Point {
Int x
Int y
}
Elsewhere, a variable of type point might be defined as follows:
Point point
Similarly, we can define a pointer to point:
Point* p1 = nullptr
Another way to determine the type of variable is provided in decltype modifier 11: the variable modifier. It allows you to determine the type of variable by the type of expression:
Decltype (point) * p2 = nullptr
What's the difference between the two ways? When the type of point changes, the type of p1 needs to be modified together, and the type of p2 does not need to be modified.
This is the same reason that the parameter sizeof () advocates the use of variable names instead of data types.
This is the end of the content of "how to use the decltype modifier of Category 11". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.