In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to write code using ISO Standard C++". In the operation of practical 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!
Write the code Note using the ISO standard C++ (notes)
Some ISO standard C++ environments need to be extended, such as when accessing system resources. In this case, locate locations that use the necessary extensions and use non-core coding guidelines to control them. If possible, build interfaces that encapsulate these extensions so that you can turn them off or exclude them from compilation on systems that do not support them.
Extensions often have no strictly defined semantics. For this reason, the behavior of even common extensions supported by multiple compilations will be slightly different, and there will be boundary behavior. Due to the heavy use of this extension, the portability we expect will be compromised.
Note (Note)
Using legitimate ISO C++ does not guarantee portability (let alone correctness). Avoid relying on undefined behavior (for example, no defined order of computation) and pay attention to concepts that may be affected by the implementation (for example, sizeof (int)).
Translator's note: it is estimated that what the author is trying to say is that the length of int may be 4 bytes or other length in different compilation environments, so the results of sizeof may be different. And don't think that as long as you use ISO C++, everything will be all right. There are still many places to pay attention to.
Note (Note)
Some environments that use the standard C++ language or the necessary library functions are limited. For example, the aircraft control software standard requires that dynamic memory allocation be avoided. In this case, you can customize the extension of this guide for a particular environment, and then use it to control the use (or non-use) of language or library features.
Enforcement (implementation recommendations)
Use the latest C++ compiler with a set of options that do not accept extensions (now Category 17 and Centrum 14 or 11).
This is the end of the content of "how to write code using the ISO standard C++". Thank you for 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.