胆囊炎是什么| 什么是抗氧化| 轻度肠上皮化生是什么意思| 香瓜什么时候成熟| 石斛什么功效| 什么原因导致脾虚| 什么情况下需要做活检| 异地办理护照需要什么材料| 米饭配什么菜好吃| 肝内胆管结石吃什么药好| 沙姜是什么姜| 什么样的人不能吃海参| 简称是什么意思| 梦见自己相亲是什么意思| 丑指什么生肖| 舌头上有白苔是什么原因| 炒菜锅什么牌子好| ca724偏高是什么意思| 恍惚是什么意思| 黑白蛇是什么蛇| 经常射精有什么伤害| 氯雷他定片是什么药| 病符是什么意思| 小鸡仔吃什么| 鸡蛋壳属于什么垃圾| 直肠肿瘤手术后吃什么| 脾胃不好喝什么茶| 苦瓜不能和什么一起吃| 后背疼是什么病的前兆| 随访复查什么意思| 胸腺肿瘤是什么病| 舌息心念什么| 5月23是什么星座| 佝偻病缺少什么元素| 低密度脂蛋白胆固醇偏低是什么意思| 最快的减肥运动是什么| 形式是什么意思| 摄影三要素是什么| 罗西尼手表什么档次| 月令是什么意思| 6月21是什么星座| 病理会诊是什么意思| 发低烧是什么原因| 披什么散什么| 玄关挂什么装饰画好| 甲状腺用什么药| 18是什么生肖| 11月20是什么星座| 眼睛干涩用什么药效果好| blood什么意思| 不以为然的意思是什么| 甲醇对人体有什么伤害| 口腔溃疡是什么| 高考准考证有什么用| 降血脂喝什么茶最好| 朝鲜韩国什么时候分开的| 戊肝阳性是什么意思| 棱角是什么意思| 血液是什么组织| 蓝色的猫是什么品种| 备孕要吃什么| 肺部肿瘤吃什么药| 功是什么| 隔阂是什么意思| 儿保是什么| aww是什么意思| 血糖高吃什么水果好| 2031年是什么年| 水加日念什么| 热疹用什么药| 碳酸氢铵是什么| 白带过氧化氢阳性是什么意思| 团购什么意思| al是什么| 不走心是什么意思| sansay是什么牌子| 手上起水泡是什么原因| 早上屁多是什么原因造成的| dears是什么意思| 拉肚子可以吃什么| 梦见买车是什么意思| 淹死是什么感觉| 吃什么可以养肝| 要强的女人是什么性格| 姑姑的孩子叫什么| 突然耳鸣是什么原因| 小猫起什么名字好听| 私定终身是什么意思| 黑洞是什么| 麝香保心丸治什么病| 电脑什么牌子好| 蚊子喜欢什么| 抗核抗体是检查什么的| 苹果手机为什么那么贵| 肾轻度积水是什么意思| 碱性磷酸酶偏高说明什么问题| 炸酥肉用什么肉最好吃| 晚上两点是什么时辰| 平常平时叫什么日| 不解之谜的意思是什么| 什么药降尿蛋白| 就让我爱你把你捧在手心里是什么歌| 日主是什么意思| 血脂血糖高吃什么食物好| a股是什么| 经期吃芒果有什么影响| 养胃吃什么最好| top1什么意思| 怀孕有褐色分泌物是什么原因| 肛门塞什么东西最舒服| 肝的主要功能是什么| 十恶大败是什么意思| 师奶是什么意思| 跖疣用什么药| 什么是邮箱地址| 悠悠岁月什么意思| 石乐读什么| 多动症是什么| g18k金是什么意思| 什么样的长城| 香兰素是什么东西| 痤疮用什么药治最好效果最快| 双角子宫是什么意思| 什么啤酒度数高| 什么洗发水好用| 1999年五行属什么| 什么叫青光眼| 一什么一什么造句| 加应子是什么水果| 淋巴滤泡增生是什么意思严重吗| 手指关节肿胀是什么原因| biubiubiu是什么意思| 泌尿外科是看什么的| 咽喉炎用什么药| 胃不好的人吃什么好| 金铃子是什么昆虫| 喝酒吃什么解酒| 男人有卧蚕代表什么| 月元念什么| rh血型阴性是什么意思| 紫荆花什么时候开| 扁平足有什么危害| 相害是什么意思| 道谢是什么意思| 过敏了吃什么药| 吃完饭恶心是什么原因| 为什么口臭| 菊花不能和什么一起吃| 如痴如醉是什么意思| 羊奶有什么作用与功效| 一日清闲一日仙是什么生肖| 梦遗是什么意思| 学杂费包括什么| 黑乌龙茶属于什么茶| 酒精胶是粘什么的| 大公鸡是什么牌子| 婢女是什么意思| 急性荨麻疹不能吃什么食物| 淋巴结肿大是什么原因| 肺气不足吃什么中成药| 河豚有毒为什么还吃| 男人喝红糖水有什么好处| 卵巢囊肿吃什么药好得最快| 舌苔又白又厚是什么原因| 黑玫瑰代表什么| 琴酒是什么酒| 手上长疣是什么原因造成的| 社会科学院是干什么的| 2020年是属什么生肖| 过敏性紫癜有什么危害| 补气养血吃什么中成药| 骆驼是什么品牌| 莘莘学子什么意思| 西装革履什么意思| 足本是什么意思| 喝水就打嗝是什么原因| 打牙祭是什么意思| 凤梨不能和什么一起吃| 小孩小便红色是什么原因| 褐色是什么颜色| 手淫过度有什么危害| 腺肌症吃什么药效果好| 左肾窦分离是什么意思| 一朵什么| 吹泡泡什么意思| 什么叫天干| 眉毛附近长痘痘是什么原因| 直捣黄龙是什么意思| 黑加京念什么| 什么是激光| 指甲上有竖纹是什么原因| 孩子老是流鼻血是什么原因| 石五行属什么| 麸炒是什么意思| 大便不成形是什么原因| 米加白念什么| 多多保重是什么生肖| 隐血试验阴性是什么意思| 四大才子是什么生肖| 白化病是什么病| 女娲是一个什么样的人| 哭什么| 谨字五行属什么| 西南属什么五行| 青瓜炒什么好吃| 右手无名指戴戒指代表什么| 沙棘是什么东西| 什么是面首| 人为什么会得白血病| 松花蛋不能和什么一起吃| 唐氏筛查临界风险是什么意思| 维生素b6是什么| 汗毛长的女人代表什么| lt是什么意思| 九斗一簸箕有什么说法| 买二手苹果手机要注意什么| 果蝇是什么| 虐狗什么意思| 长痘痘是什么原因| cua是什么意思| 蔬菜沙拉都放什么菜| 肚子老是疼是什么原因| 朝霞不出门晚霞行千里是什么意思| 天秤座和什么星座最不配| 老年痴呆症又叫什么| 指疣是什么病| 反复发烧是什么原因| 寒湿重吃什么中成药| 鱼精是什么| 黄瓜可以和什么一起榨汁| 不什么其什么的成语| loa是什么意思| 什么叫法令纹| 肺炎吃什么药最有效| 什么叫非萎缩性胃炎| 异地结婚登记需要什么证件| 狐媚子是什么意思| 脚为什么会臭| cos什么意思| 长明灯是什么意思| 日在校园讲的是什么| 高炮是什么| 血清胰岛素测定查什么| 子宫囊肿有什么症状| 富屋贫人是什么意思| 血脂稠吃什么| 行政许可是什么意思| 蝈蝈为什么不叫| 六月十一是什么日子| 免是什么意思| 舒张压偏高是什么原因造成的| 死心眼什么意思| 舌头鱼又叫什么鱼| 次是什么意思| 英语6级是什么水平| 盛情难却是什么意思| 礽是什么意思| 下眼袋大是什么原因引起的| 热敷眼睛有什么好处| 缺钾吃什么水果| 什么是心脏造影| 无国界医生是什么意思| 孔子的原名叫什么| 君主是什么意思| 百度
DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Attention Kubernetes users! DZone is researching how K8s usage is evolving in 2025 — tell us the good, the bad, + the frustrating.

Getting Started With DevSecOps: This Refcard provides actionable insights for embedding security into your DevOps culture and workflows.

Data Engineering: Not your average "AI is changing everything" report. Dive into tooling, strategy, + systems in scalable data ecosystems.

Java Caching: This Refcard explores core caching concepts and demonstrates how to implement them using Java’s JCache API.

Related

  • TypeScript in Cloud Applications: Why It’s a Powerful Choice
  • Java Enterprise Matters: Why It All Comes Back to Jakarta EE
  • What They Don’t Teach You About Starting Your First IT Job
  • MySQL Formatter: How to Make Beautiful Code and Why You Need It

Trending

  • What Developers Need to Know About IP API Privacy in Mobile Apps (2025 Update)
  • A Complete Guide to Creating Vector Embeddings for Your Entire Codebase
  • Why Developers Should Pay Attention to Internal Directory Security
  • Revolutionizing the Command Line: An Introduction to Gemini CLI

科技让驾驭更尽情-广汽本田新雅阁强者驾临-网

We look at one of the most popular object-oriented programming languages, C++, and what new features its latest iteration will bring.

By 
Rohit Sharma user avatar
Rohit Sharma
·
Sep. 20, 17 · Analysis
Likes (1)
Comment
Save
Tweet
Share
8.2K Views
百度 几年来,年度培训工作已形成常态化机制,起到了坚定青年干部理想信念、提高政治理论修养、激发工作热情、提高履职能力的作用。

Join the DZone community and get the full member experience.

Join For Free

C++ is moving really fast at the moment, well for C++. After C++14 we now have a proposal for C++17 and a new C++ every three years. Look out for C++20. So where is the language going?

Once upon a time, C++ was the language that the big kids used while the rest of the programming community looked on in awe and got on with using languages that could be regarded as, or dismissed with the idea that they were, “scripting” languages for script kiddies. However, compared to well designed, or designed from the ground up, languages like C# it was clear that not everything was right in the C++ camp.

The big problem with C++ is that it is an object-oriented language grafted on top of a machine-independent, assembler-like language, i.e. C.

You have to hand it to Bjarne Stroustrup for doing a great job. As long as you keep it simple C++ is a good and reasonably modern object-oriented language that is still close enough to the machine architecture to produce programs that run about as fast as possible. This is the reason that C++ programs are often called “native” or “native code.”

The key thing about pushing C++ forward is that the new features have to be introduced in such a way that they don’t break existing programs. This has resulted in a less-than-perfect development of the language, where there is often more than one way of achieving the same result. When this occurs programmers have to resort to seeking advice on what constitutes a “best practice” and there isn’t always consensus on this topic.

Many of the new features in C++ 14 were concerned with templates, generic programming, and type inference – trendy topics. However, if you really want to make use of them, you will encounter some seemingly complicated ideas. A few C++ programmers I know have admitted to not really following the details of the new features and have hence avoided using them except in very simple situations – and preferably not at all.

What this means is that there are a lot of C++ programmers, beginners and intermediate, who will struggle to understand what the new features are and how they can be used. The experts will be extolling the virtues of the new stuff, but the majority will be mystified. This is a strange situation and it is mostly due to C++ becoming increasingly functional.

The new variant type is a bit of a throwback to its C roots. This is essentially a union that is modified to be type-safe. In other words, a variant is able to hold any of the types it is declared to hold, but it only has one type at any given time and if you try to use the value as another type it will throw an exception. The example given is:

variant<int, float> v, w;
 v = 12;
 int i = get<int>(v);
 w = get<int>(v);
 try { get<float>(w); // will throw. }
 catch (bad_variant_access&) {}

OK, fine, but in my experience, unions are generally used when you have a bit pattern that can represent two, or even more, types of data, and, in such a case, I don’t want type safety.

The if constantexpr statement is also new, which is evaluated at compile time and provides a way of selecting what you want to be in your code. It is designed to allow templates to be more flexible and efficient. Another template addition is the use of auto. You can now allow the type of a variable to be deduced within a template. The problem is following the rules of the type inference.

A more down to earth changes relate to assigning tuples to different variables:

auto [a, b, c] = getvalues();

and you can now declare variables in an if. This is a generalization of declaring variables in a for but really it’s syntactic sugar over the block scoping of C++. For example, you can write:

if(int x = 42; true != false){}

Now, this really is going to blow the mind of any beginner already confused by == and =. I’m not sure it is worth the minor advantage for the huge loss of simplicity – never use an = in an if.

IT

Published at DZone with permission of Rohit Sharma. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • TypeScript in Cloud Applications: Why It’s a Powerful Choice
  • Java Enterprise Matters: Why It All Comes Back to Jakarta EE
  • What They Don’t Teach You About Starting Your First IT Job
  • MySQL Formatter: How to Make Beautiful Code and Why You Need It

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

肾结石吃什么水果 脚背浮肿是什么原因引起的 鱼喜欢吃什么 做梦掉牙齿是什么意思周公解梦 pta是什么
二级教授是什么意思 照看是什么意思 小孩说话晚是什么原因 欢喜冤家是什么意思 血气是什么意思
什么可以变白皮肤 吃什么对心脏好 半联动是什么意思 呆呆的笑是什么笑 老实忠厚是什么生肖
手指甲发黑是什么原因 宫颈糜烂用什么药比较好 指什么门 巨细胞病毒是什么病 肾窦分离是什么意思
化合物是什么hcv7jop5ns3r.cn 七月属什么生肖hebeidezhi.com 阳痿是什么意思hcv8jop7ns4r.cn 梦见和尚是什么预兆hcv8jop4ns3r.cn ck什么意思hcv9jop0ns7r.cn
ny什么牌子beikeqingting.com 翘嘴鱼是什么鱼hcv8jop2ns1r.cn 1958年是什么年hcv8jop8ns1r.cn 偏头疼是什么症状hcv8jop0ns4r.cn 各自安好是什么意思hcv9jop1ns1r.cn
老年人反复发烧是什么原因引起的hcv9jop6ns1r.cn 为什么叫清明上河图hcv8jop7ns5r.cn 技校是什么学历hcv8jop5ns2r.cn 6月29日是什么星座wmyky.com 迎刃而解是什么意思hcv8jop6ns0r.cn
腋下黑是什么原因hcv9jop5ns2r.cn mio是什么意思hcv9jop6ns7r.cn 高血压中医叫什么病hcv8jop5ns4r.cn 红枣和灰枣有什么区别hcv8jop5ns9r.cn 薏米是什么hcv9jop1ns0r.cn
百度