Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
313 views
in Technique[技术] by (71.8m points)

c++ - C ++ 17中有哪些新功能?(What are the new features in C++17?)

C++17 is now feature complete, so unlikely to experience large changes. (C ++ 17现在功能齐全,因此不太可能经历大的变化。) Hundreds of proposals were put forward for C++17. (为C ++ 17提出了数百个提案。)

Which of those features were added to C++ in C++17? (在C ++ 17中,哪些特性被添加到C ++中?)

When using a C++ compiler that supports "C++1z", which of those features are going to be available when the compiler updates to C++17? (当使用支持“C ++ 1z”的C ++编译器时,当编译器更新到C ++ 17时,哪些功能可用?)

  ask by Yakk - Adam Nevraumont translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Language features: (语言特色:)

Templates and Generic Code (模板和通用代码)

Lambda (LAMBDA)

Attributes (属性)

Syntax cleanup (语法清理)

Cleaner multi-return and flow control (更清洁的多回程和流量控制)

  • Structured bindings (结构化绑定)

    • Basically, first-class std::tie with auto (基本上,一流的std::tieauto)
    • Example: (例:)
      • const auto [it, inserted] = map.insert( {"foo", bar} ); <

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...