In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how C++ realizes that the template parameters are at least formal or semi-formal". The content in the article is simple and clear and easy to learn and understand. let's study and learn "C++ how to achieve template parameters are at least formal or semi-formal"!
T.46: template parameters are required to be at least normal or semi-normal
Reason (reason)
Readability. Preventing surprises and errors. Most uses support that anyway.
Readability. Prevent unexpected code and errors. Anyway, many uses already support this.
Example (sample)
Class X {
Public:
Explicit X (int)
X (const X &); / / copy
X operator= (const X &)
X (X &) noexcept; / / move
X & operator= (X &) noexcept
~ X ()
/ /... No more constructors...
}
X x {1}; / / fine
X y = x; / / fine
Std::vector v (10); / / error: no default constructorNote (note)
Semiregular requires default constructible.
Semi-formal requirements can be constructed by default.
Enforcement (implementation recommendations)
Flag types that are not at least SemiRegular.
Tags types that are not even implemented by semi-normal.
Thank you for your reading, the above is the "C++ how to achieve template parameters are at least formal or semi-formal" content, after the study of this article, I believe you on C++ how to achieve template parameters are at least formal or semi-formal this problem has a deeper understanding, the specific use of needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.