welcome back to c++ rvalue referencesforward declared enumsbidirectional fences...
TRANSCRIPT
![Page 1: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/1.jpg)
Peter Torr, [email protected] Manager, Windows Phone Developer Platform
Using C++ in your Windows Phone Applications
![Page 2: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/2.jpg)
Agenda
C++ support in Windows Phone 8
When and why to use C++
Introduction to Windows (Phone) Runtime
~30 minutes of demos!
![Page 3: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/3.jpg)
Welcome back to C++
![Page 4: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/4.jpg)
![Page 5: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/5.jpg)
C++ support in Windows Phone 8Visual C++ 2012
Same as Windows 8
New C++11 features
![Page 6: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/6.jpg)
A sampling of C++ language features supported in Windows Phone 8
C++ support in Windows Phone 8
RValue references Forward declared enums Bidirectional fences
static_assert AlignmentData-dependency ordering
AutoStandard-layout and trivial types
exception_ptr
Trailing return types
Extended friend declarations Thread-local storage
LambdasLocal and unnamed types as template arguments
__func__
Decltype Range-based for-loop C99 preprocessor
Right angle brackets override and final long long
extern templates Minimal GC support
nullptr Atomics
Strongly typed enums Strong compare and exchange
Derived from http://msdn.microsoft.com/en-us/library/hh567368.aspx
![Page 7: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/7.jpg)
Brief walk-through of key C++ features
Direct3D default template
DEMO:Quick tour of C++ features
![Page 8: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/8.jpg)
When and why to use C++
![Page 9: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/9.jpg)
Using C++ in Windows Phone appsAll Windows Phone 8 apps can use native
code
Direct3D games: Pure native
XAML apps: Native compute + Direct3D
...but not all apps need to use native codeSee 3-046 for more on native games
![Page 10: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/10.jpg)
Top 3 use cases for C++
There is no requirement to use C++ in your XAML apps
123
PerformanceReusabilityPortability
![Page 11: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/11.jpg)
Using legacy code in Windows Phone 8 apps
DEMO:C++ code re-use
![Page 12: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/12.jpg)
reinterpret_cast<Phone>(WindowsRuntime)
Introduction to Windows (Phone) Runtime
![Page 13: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/13.jpg)
APIsInfrastructure
What is the Windows Runtime?
Core plumbing
Common type system
Standard programming
model
Windows Phone features
Libraries you write (or
license)
Projected to C++ and C# /
VB
![Page 14: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/14.jpg)
When is the Windows Runtime used?Calling APIs
Native / Managed Interop
Direct3D game app model
![Page 15: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/15.jpg)
Calling APIs from C#
Creating a component in C++ and using from C#
The magic of async
DEMO:Windows Runtime
![Page 16: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/16.jpg)
Writing portable components
![Page 17: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/17.jpg)
Sharing code across platforms
With iOS and Android:Standard C and C++Common librariesMiddleware providers
With Windows 8, add:Windows RuntimeWin32 and COM
See 3-043 for more on Windows 8 portability
![Page 18: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/18.jpg)
Real-world example of common open source library
Another look at async
DEMO:Using SQLite in Windows Phone 8
![Page 19: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/19.jpg)
Wrap-up
![Page 20: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/20.jpg)
Key takeaways for using C++
All Windows Phone 8 apps can use C++
C++ enables portability and code re-use
Windows Runtime is the key to unlocking
APIs
![Page 21: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/21.jpg)
Please fill out an evaluation form!
![Page 22: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/22.jpg)
Related sessions (live or on-line)
Session
Title Speaker
3-046 Native C/C++ Game Development Sam George
3-047Networking, Bluetooth, and NFC Proximity for Developers Tim Laverty
3-043How to leverage your code across WP8 and Windows 8
Andrew Byrne et al
2-018 Photo and Lens Apps Eric Bennett
4-001The power of C++ - Project Austin(not phone specific, but a great talk)
Ale Contenti
![Page 23: Welcome back to C++ RValue referencesForward declared enumsBidirectional fences static_assertAlignmentData-dependency ordering AutoStandard-layout](https://reader035.vdocument.in/reader035/viewer/2022070412/5697bf8b1a28abf838c8b4b0/html5/thumbnails/23.jpg)
© 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.