Presentation is loading. Please wait.

Presentation is loading. Please wait.

reasons to move your C++ code to Visual Studio

Similar presentations


Presentation on theme: "reasons to move your C++ code to Visual Studio"— Presentation transcript:

1 reasons to move your C++ code to Visual Studio
7/2/2018 8:57 PM BRK3305 7 reasons to move your C++ code to Visual Studio 2017 Rong Lu Principal Program Manager Visual C++ team © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2 7 2017 One IDE to: #1 write modern, portable C++ #2 pain-free upgrades
7/2/2018 8:57 PM One IDE to: #1 write modern, portable C++ #2 pain-free upgrades #3 build faster, run faster #4 make you more productive #5 edit, build, debug Any code (via Open Folder) #6 target multiple platforms #7 streamline your installation reasons you will love Visual Studio 7 2017 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

3 #1 write modern, portable C++
7/2/2018 8:57 PM #1 write modern, portable C++ reasons to move your C++ code to Visual Studio 7 2017 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

4 MSVC Conformance C++11 C++14 C++17 C++TS (experimental)
Completed in VS2017 RTM or earlier Completed in VS Targeting in VS Two-phase Name Lookup (partial support) under /permissive- Targeting in VS C++11 default/deleted func, Inline namespaces, User-defined literals, noexcept, char16_t/char32_t, alignas/alignof, __func__, Extended sizeof, Inheriting constructors, Unicode string literals, Magic statics, thread_local, Unrestricted unions, Attributes, Universal char names in literals, Data-dep ordering attributes, constexpr, Expression SFINAE (via Boost), Expression SFINAE (via more libraries), STL: All C++11 Features C++14 auto, decltype(auto) return types, Generic lambdas, Generalized lambda captures, Binary literals, Sized Deallocators, Deprecated attribute, Digit separator, Variable Templates, NSDMI for Aggregates, STL: All C++14 Features, Extended Constexpr C++17 Auto with braced-init list, u8 char literal, Attributes on namespace and enum, Removing trigraphs, typename in template template-param, Nested Namespace, Ignoring unrecognized attributes, Terse static_assert, Attribute [[fallthrough]], Generalized range-based for-loops, STL:<any>, STL:<optional>, STL:<string_view>, STL:<variant>, STL:<algorithm> sample(), STL:<tuple> apply() Structured Bindings Selection statements with initializers Construction rules for enum class values Constexpr lambdas if constexpr __has_include Capturing *this by value Using attribute namespaces without repetition [[maybe_unused]] [[nodiscard]] Removing operator++ for bool Remove register keyword STL:<string_view> UDLs Over-aligned dynamic memory allocation Allowing more non-type template args Fold expressions Removing some empty unary folds Adding noexcept to the type system Inline variables Removing dynamic-exception-specifications Hexfloat literals Matching template template-parameters to compatible arguments Refining expression evaluation order Declaring non-type template parameters with auto Rewording inheriting constructors Fixing qualification conversions Guaranteed copy elision Pack expansions in using-declarations Extended aggregate initialization Template argument deduction for class templates C++TS (experimental) C++ Coroutines Filesystem* C++ Modules C++ Concepts

5 std::optional<T>
Microsoft Build 2017 7/2/2018 8:57 PM std::optional<T> bool reduce(Item it, /*in, opt*/ Item* subitem, /*out*/ CachedItem* ret) { CachedItem* retVal; if (download(it, retVal)) { if (subitem != nullptr) { CachedItem* subItemRet; if (download(*subitem, subItemRet)) { retVal->addSubitem(*subItemRet); } else return false; return true; return false; Item i(...), j(...); CachedItem* ret = nullptr; if (reduce(i, &j, ret)) { cout << ret->name << endl; After optional<CachedItem> reduce(Item it, optional<Item> subitem) { CachedItem* retVal; if (download(it, retVal)) { if (subitem) { CachedItem* subItemRet; if (download(*subitem, subItemRet)) { retVal->addSubitem(*subItemRet); } else return nullopt; return *retVal; return nullopt; Item i(...), j(...); auto ret = reduce(i, j); if (ret) { cout << ret->name << endl; Before Return parameter is not set! Return value is set. © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

6 MSVC Conformance C++11 C++14 C++17 C++TS (experimental)
Completed in VS2017 RTM or earlier Completed in VS Targeting in VS Two-phase Name Lookup (partial support) under /permissive- Targeting in VS C++11 default/deleted func, Inline namespaces, User-defined literals, noexcept, char16_t/char32_t, alignas/alignof, __func__, Extended sizeof, Inheriting constructors, Unicode string literals, Magic statics, thread_local, Unrestricted unions, Attributes, Universal char names in literals, Data-dep ordering attributes, constexpr, Expression SFINAE (via Boost), Expression SFINAE (via more libraries), STL: All C++11 Features C++14 auto, decltype(auto) return types, Generic lambdas, Generalized lambda captures, Binary literals, Sized Deallocators, Deprecated attribute, Digit separator, Variable Templates, NSDMI for Aggregates, STL: All C++14 Features, Extended Constexpr C++17 Auto with braced-init list, u8 char literal, Attributes on namespace and enum, Removing trigraphs, typename in template template-param, Nested Namespace, Ignoring unrecognized attributes, Terse static_assert, Attribute [[fallthrough]], Generalized range-based for-loops, STL:<any>, STL:<optional>, STL:<string_view>, STL:<variant>, STL:<algorithm> sample(), STL:<tuple> apply() Structured Bindings Selection statements with initializers Construction rules for enum class values Constexpr lambdas if constexpr __has_include Capturing *this by value Using attribute namespaces without repetition [[maybe_unused]] [[nodiscard]] Removing operator++ for bool Remove register keyword STL:<string_view> UDLs Over-aligned dynamic memory allocation Allowing more non-type template args Fold expressions Removing some empty unary folds Adding noexcept to the type system Inline variables Removing dynamic-exception-specifications Hexfloat literals Matching template template-parameters to compatible arguments Refining expression evaluation order Declaring non-type template parameters with auto Rewording inheriting constructors Fixing qualification conversions Guaranteed copy elision Pack expansions in using-declarations Extended aggregate initialization Template argument deduction for class templates C++TS (experimental) C++ Coroutines Filesystem* C++ Modules C++ Concepts

7 C++ Core Guidelines C++ Core Check validates your code
Microsoft Build 2017 7/2/2018 8:57 PM C++ Core Guidelines C++ Core Check validates your code (part of C++ Code Analysis) Bounds checks Type checks Resource management checks Interfaces; Expressions and Statements Guidelines Support Library span<T> not_null<T> owner<T>, and more Install GSL from: Source code: © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

8 7 #2 pain-free upgrades 2017 Visual Studio
7/2/2018 8:57 PM #2 pain-free upgrades reasons to move your C++ code to Visual Studio 7 2017 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9 Pain-free upgrade – install VC++ 2015 toolset is easy
Microsoft Build 2016 7/2/2018 8:57 PM Pain-free upgrade – install VC toolset is easy Install VS2015 VC++ toolset in the VS2017 installer © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

10 Demo Microsoft Build 2017 7/2/2018 8:57 PM
© Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

11 Pain-Free Upgrade You can upgrade in different ways at your own pace…
Compile projects with the VC toolset while enjoying the VS2017 IDE features Link VS2017 projects against VS2015 libs with no code change - Binary compatibility between the VS2015 and VS2017 runtimes VC Toolset and C++ Language Standard of your choice.

12 Pain-Free Upgrade (cont’d)
7/2/2018 8:57 PM Pain-Free Upgrade (cont’d) Vcpkg: package manager for open-source C++ libs on Windows Support 350+ libs already (vcpkg install <libname>) Make libs available to VS projects (vcpkg integrate install) On GitHub: Online Resources Porting and Upgrading Guide: GitHub repo: © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

13 Developer Inner Loop Read & Edit Diagnose Commit Compile Test
Microsoft Build 2016 7/2/2018 8:57 PM Developer Inner Loop Read & Edit Create and update your code Diagnose Fix and optimize your code Commit Share your code Compile Build your code Test Validate your code © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

14 #3 build faster, run faster
7/2/2018 8:57 PM #3 build faster, run faster reasons to move your C++ code to Visual Studio 7 2017 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

15 Build faster, less memory consumption
Build and link faster Linker 30% faster than VS2015. Building SPEC 2017 is 20% faster than VS2015 end to end. /debug:fastlink on by default in VS2017 (2-4x faster than the old default /debug:full) Solutions load faster and consume less memory IntelliSense is faster when no PCH is configured (use auto-precompiled headers) Memory usage during debugging significantly decreased Chromium 4600 Solution Items VS 2015 Update 3 VS 2017 Improvement Time - First Solution Open (s) 1,213 s 182 s 6.6x Time – Subsequent Solution Open (s) 1,211 s 68 s 17.8x Private Working Set (MB) 2,293 MB 804 MB 2.8x Virtual Memory (MB) 3,066 MB 1,302 MB 2.3x aka.ms/vcperf

16 Your code runs faster Code generated by VS2017 runs 9% faster than VS2015 by just re- compiling with VS2017 toolset Taking advantage of the new SSA-based optimizer Many inliner improvements Improved loop optimizations SPEC 2017 Benchmark VS 2015 Update 3 VS 602.gcc_s 521 443 605.mcf_s 572 546 620.omnetpp_s 402 393 623.xalancbmk_s 163 157 625.x264_s 269 204 631.deepsjeng_s 317 302 641.leela_s 450 431 657.xz_s 2247 2101 619.lbm_s 943 869 638.imagick_s 5721 4891 644.nab_s 1907 1637 508.namd_r 226 222 510.parest_r 287 280 511.povray_r 336 337 526.blender_r 278 239

17 #4 make you more productive
7/2/2018 8:57 PM #4 make you more productive reasons to move your C++ code to Visual Studio 7 2017 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

18 Demo Microsoft Build 2017 7/2/2018 8:57 PM
© Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

19 C++ Productivity Read & Edit
Microsoft Build 2017 7/2/2018 8:57 PM Compile Test Diagnose Read & Edit Commit C++ Productivity Read & Edit Predictive IntelliSense, IntelliSense filtering, Code formatting enforcement with editorconfig Manage a large list more easily with Find All References (better perf coming in 15.5) Navigate To -> Go To with filtering Improved Error List results Coming soon: Ctrl + Click to Go To Definition, Structure Visualizer in-box (download the extension in the meantime) Diagnose Run to Click, Reattach to Process, Improved Exception Helper, Break-on-exception conditions, Improved Memory and CPU profiler Test Test Adapter for Google Test Test Adapter for Boost.Test Commit Force push your changes SSH support for remotes View Commit Diff Compile /debug:fastlink 30% improvements OSS libs from © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

20 #5 edit, build, debug Any code (via open folder)
7/2/2018 8:57 PM #5 edit, build, debug Any code (via open folder) reasons to move your C++ code to Visual Studio 7 2017 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

21 Microsoft Build 2017 7/2/2018 8:57 PM Open Folder and CMake Edit, build, debug Any Code by simply opening the source folder in VS2017 Ideal for non-MSBuild projects (CMake, make, or any other C++ build systems) Full C++ IntelliSense and code browsing support Flexible integration of external build processes Familiar Visual Studio debugging experience Out-of-box support for CMake projects F5 just works! © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

22 Demo Microsoft Build 2017 7/2/2018 8:57 PM
© Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

23 #6 target multiple platforms
7/2/2018 8:57 PM #6 target multiple platforms reasons to move your C++ code to Visual Studio 7 2017 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

24 Android C++ Development
Microsoft Build 2017 7/2/2018 8:57 PM Android C++ Development © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

25 iOS C++ Development Microsoft Build 2017 7/2/2018 8:57 PM
© Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

26 Demo: Linux Development
Microsoft Build 2017 7/2/2018 8:57 PM Demo: Linux Development © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

27 Microsoft Build 2017 7/2/2018 8:57 PM Linux C++ Development C++ Linux Development workload now part of VS installer. Target any Linux distro with SSH, gdbserver and compiler. Use the full power of the VS debugger with your C/C++ Linux development IntelliSense & Code browsing out of the box for GCC and stdlibc++ easily extended by importing your own headers. Bring your existing build processes with the makefile project support © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

28 #7 streamlined installation
7/2/2018 8:57 PM #7 streamlined installation reasons to move your C++ code to Visual Studio 7 2017 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

29 5 C++ workloads Desktop development with C++
Microsoft Build 2016 7/2/2018 8:57 PM 5 C++ workloads Desktop development with C++ Universal Windows Platform development Mobile development with C++ Game development with C++ Linux development with C++ aka.ms/vcinstaller © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

30 7 #7++ you helped build it 2017 Visual Studio
7/2/2018 8:57 PM #7++ you helped build it reasons to move your C++ code to Visual Studio 7 2017 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

31 fixed bugs publicly reported through Connect & IDE
You Helped Us Build It! Visual Studio User Voice “Report a Problem…” tool 2,887 Votes on UserVoice 1,376 fixed bugs publicly reported through Connect & IDE

32 7 2017 #1 write modern, portable C++ #2 pain-free upgrades
7/2/2018 8:57 PM #1 write modern, portable C++ #2 pain-free upgrades #3 build faster, run faster #4 make you more productive #5 edit, build, debug Any code (via Open Folder) #6 target multiple platforms #7 streamline your installation #7++ you helped build it reasons you will love Visual Studio 7 2017 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

33 7/2/2018 8:57 PM Now it’s your turn! Tell us about reasons that you can’t move to VS2017  OR, your experience moving to VS2017 © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

34 Please evaluate this session
Tech Ready 15 7/2/2018 Please evaluate this session From your Please expand notes window at bottom of slide and read. Then Delete this text box. PC or tablet: visit MyIgnite Phone: download and use the Microsoft Ignite mobile app Your input is important! © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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.

35 7/2/2018 8:57 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "reasons to move your C++ code to Visual Studio"

Similar presentations


Ads by Google