Presentation is loading. Please wait.

Presentation is loading. Please wait.

C++: соответствие стандартам и кросс-платформенная разработка

Similar presentations


Presentation on theme: "C++: соответствие стандартам и кросс-платформенная разработка"— Presentation transcript:

1 C++: соответствие стандартам и кросс-платформенная разработка
Дмитрий Андреев Эксперт по разработке

2 Содержание Соответствие стандартам Кросс-платформенный код и C++
Ресурсы

3 VC++ соответствие стандартам
Build 2013 5/31/2018 VC++ соответствие стандартам __func__ Extended sizeof Thread-safe function local static init Inline namespaces UCNs in literals char16_t, char32_t Implicit move generation alignof alignas thread_local Unrestricted unions Attributes Expression SFINAE Ref-qualifiers: & and && for *this noexcept (unconditional) noexcept (full) C++11 preprocessor (incl. C++98 & C11) C++14 decltype(auto) Inheriting constructors constexpr (except ctors, literal types) C++98 two-phase lookup C++14 auto function return type deduction User-defined literals constexpr (full) C++14 extended constexpr C++14 generic lambdas (partial) C++14 generalized lambda capture C++14 generic lambdas (full) C++14 variable templates C++TS? await (partial) C++14 libs: std:: user-defined literals C++TS? await C++TS concepts Visual Studio 2015 VC++ Nov 2013 CTP Available in CTP3+ Med. probability RTM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

4 Terse Range-Based For Loops
5/31/2018 Terse Range-Based For Loops #include <iostream> #include <string> #include <vector> using namespace std; int main() { std::vector<int> v = { 1, 2, 3 }; for (i : v) printf("%d ", i); } © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

5 Generalized lambda capture
5/31/2018 Generalized lambda capture #include <iostream> #include <string> #include <vector> #include <memory> using namespace std; auto f(int i) { std::unique_ptr<int> p = std::make_unique<int>(i); return [=](int j){ return *p + j; }; //C2280 //return [q = std::move(p)](int j){ return *q + j; }; } int main() © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

6

7 Рефакторинг C++ Rename Extract function Implement pure virtuals
5/31/2018 Рефакторинг C++ Rename Extract function Implement pure virtuals Create declaration/definition Move Definition location Convert to Raw-string literal To hide comments/strings from the preview window results, leave "Search comments/strings" unchecked. To show all comments/strings in the preview window, but leave each entry unchecked by default, leave "Rename comments/strings" unchecked. To show and check by default all comments/strings, check "Rename comments/strings." For more information (from the feature's extension days), watch "Rename" Refactoring for Visual C++ on Channel 9. © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

8 Ускорение сборки cl /Zc:inline link /Debug:FastLink
link /LTCG:incremental

9 Кросс-платформенная разработке и C++
Что поменялось в мире Как сделать ваше приложение доступным для 95%+ пользователей? До этого: Выпустите приложение для windows Сегодня: Выпустите для Windows, OS X, Android, и iOS Что нового в C++ для Visual Studio Как мы поддерживаем современную разработку на C++? До этого: Visual C++ (c1xx, c2) - Windows, WP, Xbox Сегодня : Visual C++ (c1xx, c2) - Windows, WP, Xbox и Clang & LLVM для Android (и скоро iOS)

10 Дорогая модель для кросс-платформенной разработки
Win, WP OS X Android iOS C#, XAML, C++ Obj-C, Swift Java Obj-C, Swift

11 Современная модель кросс-платформенной разработки
Win, WP OS X Android iOS C#, XAML Obj-C Java Obj-C C++ Mini-PALs Mini-PALs Mini-PALs Mini-PALs

12 Пример - PowerPoint Win, WP OS X Android iOS C++

13 Ресурсы CppCon talks (Sep 2014) www.visualstudio.com
From the Dropbox Trenches: A Deep Dive into Two Cross-Platform Mobile Apps Written in C++ (1 hour) C++ in Microsoft Office: How Microsoft Uses C++ to Deliver Office Applications Across Windows, Apple, Android, and Web Platforms (2 hours) blogs.msdn.com/b/vcblog


Download ppt "C++: соответствие стандартам и кросс-платформенная разработка"

Similar presentations


Ads by Google