SlideShare a Scribd company logo
1 of 60
Philipp Aumayr
                                software architects gmbh



                           Web http://www.timecockpit.com
                           Mail philipp@timecockpit.com
Visual C++ 2012          Twitter @paumayr


Improvements over 2008
                                 Saves the day.
Intro
 DI   Philipp Aumayr
 Senior   Developer @ software architects (time cockpit)
 9-5   -> C#, 5->9 C++, 24/7 VS 2012
 Twitter:   @paumayr
 Blog:   http://www.timecockpit.com/devblog/
Motivation
 Visual   Studio 2012 improvements over 2008
 New Shell
 New Editor
 Better Intellisense
 Unit Testing
 Code Coverage
 Code Analysis
 #include completion
 Navigate To
 Type visualizers
Motivation
 C++11
 New standard released August 12, 2011
 Major overhaul
    Bjarne Stroustrup: „C++11 feels like a new language“
 Visual Studio 2012 has partial support
    Is updated out-of-band (November CTP adds major language parts)

 auto, decltype, range-based for loop
 lambdas, explicit overrides, static_assert
 nullptr, enum classes, move-semantics, variadic templates,
 initializer_lists, delegating constructors,
 explicit conversion operators
Motivation
   STL improvements
    shared_ptr, unique_ptr
    unordered_set, unordered_map
    SCARY iterators + container sizes

   Move Semantics

   std::async

   Code Analysis

   SDL
Motivation
   Auto-vectorization

   Auto-parallelization

   C++ AMP




     A lot to learn, but well worth the effort!
IDE Improvements
   Multi-monitor support
    Rewritten in WPF and MEF

   Improved responsiveness
    Intellisense works in the background
    Asynchronous project loading

   Editor Zooming
   Navigate-To
   Call Hierarchy
   Demo
IDE Improvements
   Preview tab
   Pinned editor windows
   Ctrl + Q / Search Menu
   New Solution explorer
    Scope to this
    multiple views

   Find within editor
   Find all references
   Demo
Test Framework
 Supports     writing unit tests for MSTest
 Test adapters for other test frameworks are available
 Gtest
 xUnit++

 Test   Explorer Window
 Grouping

 Code    Coverage
 Demo
Better Intellisense
 Uses   an SDF (SQL CE database) instead of the ncb
 Faster

 More   robust
 Demo
Type Visualizers (Natvis)
 Allow      customizable data representation in debugger
    Replaces autoexp.dat
    Easier to handle, more powerful

 Create       a natvis file
    Place in either
       %VSINSTALLDIR%Common7PackagesDebuggerVisualizers (requires admin access)
       %USERPROFILE%My DocumentsVisual Studio 2012Visualizers
       Or VS extension folders

   Files are reloaded at every debugging session
    No restart required when changing natvis files
Type Visualizers (Natvis)
 Example      natvis file




 Allows
 conditional strings, node expansions, item lists, tree items, synthetic items, etc.
Break
New Editor
Better Intellisense
Unit Testing
Code Coverage
Code Analysis
#include completion
Navigate To
Type visualizers
Break
 Questions?
C++ Styles (Question)
C   with a C++ compiler?
C   with classes / inheritance?
 RAII,   Exceptions, Smart pointer?
 STL?

 TMP?
auto
 Automatically       deduces type information
 Very similar to „var‟ in c#
 Reduces amount of typing required

 Reference      or Value?
 Value by default, add & to make it a reference

 Demo
decltype
 Represents       the type of the expression
 decltype(2*3) -> int
 decltype(a) -> type of a

 Why?
 Let types flow!

 Demo
Range based for loop
 New   type of for loop
 Iterates   all members of a collection
 Demo
Lambdas
 Anonymous        Functions
 Allows   logic to be placed where required
 Can   capture environment
 General    syntax:
 [capture](parameters)->return-type{body}

 represent    by type std::function<>
Lambdas
 Finally   make STL algorithms useable
 Reduces      amount of (boilerplate-)code
  No more functor classes!
Lambda Captures
 A Lambda        can capture environment
 Allows the lambda to access and modify state

 Capture      kinds
 -   reference or value
 -   automatic or specific

 Demo
override and final
   Explicitly defines overrides
    Compiler helps if no method to override is found

   Helps with refactoring
    Rename method in base class but not in derived -> derived method no longer overrides
    Base class from third party!

   Helps class design
    Implementers of derived classes can more easily understand which methods to override

   final can be used on classes to prevent being derived from

   Demo
override and final
static_assert
 Tests   a software assertion at compile time
 Especially     useful for portable code
 Assert size of specific structures (x86, x64 issues)

 Check    library versions
 Used    to be accomplished using the preprocessor
 Demo
nullptr
0   / NULL used to indicate a null pointer
 nullptr   is of type nullptr_t
 implicitly   assignable to any pointer
 not   assignable to int etc.
enum classes
 C++03    enums
 Not type safe
 Enums of different types can be compared (basically integers)
 Storage type int

 C++11    enum classes
 Type is compared as well!
 Underlying type can be chosen
enum classes
 C++03   enums
enum classes
 C++11   enum classes
Initializer lists (CTP)
Initializer lists (CTP)
 Eases   construction of non-POD types
 Finalversion will provide initialize list constructors for
  STL types
 Binds   {…} syntax to the std::initializer_list<T> type.
 Current   STL does not support it
 Demo                                  name == “class std::initializer_list<int>”
variadic templates (CTP)
 Flexible   number of template arguments
 Usable    for template writers
  n-ary structures (tuples)
  e.g. make_shared, make_tuple
  Example: saveprint

 Beware     of dragons ;)
 Demo
Move Semantics
 C++03:     many (temporary) class instances
 Resulted in a lot of copying
 Constructs to work around
 Passing complex data structure from function

 C++11:     Move semantics
 If the copied value is an rvalue reference, the move constructor is called
Move Semantics
 Dramatically   changes style!
C++03                             C++11
Move Semantics
 Note:   right-hand version is valid C++03 code!
  But advanced programmers avoided it, due to the extra copy involved.

 Now    with C++11: Elegant AND Fast
  Reconsider the patterns you are used to

 All   STL containers implement move semantics
  Returning container was unavoidable? -> automatic performance improvement!

 STL    code will have fewer temporary objects
 Demo
Break
 C++11
 auto, decltype, range-based for loop
 lambdas, explicit overrides, static_assert
 nullptr, variadic templates,
 initializer_lists, enum classes,
 move-semantics
std::async
 C++    11 has built-in support for asynchrony
 available through <future> header

 std::async<T>(std::function)                returns a future<T>
 -   Different launch policies (synchronous, asynchronous)
 -   can be waited on using wait() or get() to retrieve the result

 Implemented          in VC++ using PPL (parallel patterns
 library)
 -   Highly scalable and performant
std::async
 Not
    every asynchronous operation is a thread / cpu
 bound
 Notably IO requests
 User Input etc.

 std::future<T>       can be created from a std::promise<T>!
 std::promise<T>        acts as a provider for a future
 Marshalls result between threads of execution
 correct locking / etc.
 Provides set_value / set_exception
std::async
               T1              T2




                    (Blocks)




Demo
Parallel Patterns Library
 Based     on ConcRT
 Compatible       to Intel Thread Building Blocks (TBB)
 At least interface wise

 Template      Library for parallel programming
 Abstracts concurrent workflows into tasks
 Provides continuations (improvement over std::future<T>)

 Demo
Auto Vectorization
 Modern      CPUs support SIMD
 Single Instruction Multiple Data
 Extensions such as SSE and AVX
 Usually optimized for specifically using compiler intrinsics or inline assembler

                                 Serial                            Vector
                                   x = x1 + x2                  xyzw = xyzw1 + xyzw2


                                   y = y1 + y2


                                   z = z1 + z2


                                  w = w1 + w2
                            τ
Auto Vectorization
 VC++    2012 compiler has an auto-vectorizer (-Qvec)
 Tries to automatically vectorize loops and operators
 Enabled by default
 Diagnosis output using /Qvec-report:2

 Performance        difference?
 Depends.
 Max 4x for SSE (128bit), 8x for AVX (256bit),
 3x-4x typical

 Demo     (later with auto parallelization)
Auto-Parallelization
 To   utilize multiple cores, parallelization is used (MIMD)
 Multiple-Instructions-Multiple-Data

 VC++2012         has an auto-parallelizer
 Can be hinted
    #pragma loop(hint_parallel(N))
    #pragma loop(ivdep)
 Enabled using /Qpar
 Diagnosis using /Qpar-report:2

 Demo
C++ AMP
   Open specification created by Microsoft

   C++ for GPGPU
    Massively Parallel / Vector programming
    Based on top of DirectCompute (windows)
    Clang / LLVM implementation using OpenCL is available
       Provided by Intel (“Shevlin Park”)


   One new keyword
    Restricts the decorated function to a specific subset of c++

   Template library for wrapping data structures
    Datatransfer to/from GPU etc.
Why C++ AMP?
   Directly available from the compiler
    No additional SDK required
    Can reuse types (vector2f e.g.)

   Better debugging experience
    compared to CUDA / OpenCL!

   Makes C++ applicable to heterogeneous computing
    A processor may consist of multiple cores of different flavor
    More energy efficient (mobile!)
    visual computing
       image morphing
       Augmented reality etc.


   Demo
Smaller container sizes
   X86       release, sizes in bytes
Container                 VC9 SP1 / SCL = 0   VC10 (2010)   VC11 (2012)
                          (2008)
vector<int>               16                  16            12
deque<int>                32                  24            20
forward_list<int>         N/A                 8             4
queue<int>                32                  24            20
stack<int>                32                  24            20
unordered_map<int, int>   44                  44            32
string                    28                  28            24
wstring                   28                  28            24 ~14% less!
Smaller container sizes
   x64       release, sizes in bytes
Container                 VC9 SP1 / SCL = 0   VC10 (2010)   VC11 (2012)
                          (2008)
vector<int>               32                  32            24
deque<int>                64                  48            40
forward_list<int>         N/A                 16            8
queue<int>                64                  48            40
stack<int>                64                  48            40
unordered_map<int, int>   88                  88            64
string                    40                  40            32
wstring                   40                  40            32 ~20% less!
Code Analysis
   Static analysis

   Provides warnings at compile time

   Additionally to /GS and /SDL

   Detailed information on warning
Code Analysis
   What does it check ?
    Uninitialized Reads
    HRESULT verification checks
    Concurrency Warnings
    Format string checks
    Correct destructor calls (delete[] vs delete)
    Redundant code checks
    Many more: http://msdn.microsoft.com/en-us/library/a5b9aa09.aspx



   Custom code can be annotated to aid code analysis
    See http://msdn.microsoft.com/en-us/library/ms182032.aspx


   Demo
Break
 std::async

 ppl

 auto   vectorization
 auto   parallelization
 container   sizes
 code   analysis
Custom Snippets
 .snippet   is supported, same as C#
 XML file describing a code snippet
 Declare variables and use them in the snippet body

 Very   helpful for similar but not equivalent code
 Demo
Debug View
 Pin   watch to source code
 Add comments
 Not only variables, but (most) expressions




 View   values from last debug session
 Export   / Import Data Tips
 Makes it easier for debugging with multiple developers / on different machines

 Demo
Parallel Stacks Window
 New   view for debugging
 Better   understanding of multi thread applications
Parallel Tasks Window
 Lists   the task queues
Parallel Watch Window
 Watch     expressions in parallel
 Especially useful in tight loops
 Data races                           Expressions
 Can freeze / thaw threads
 Manually verify locking

 Demo
 Parallel Stacks
 Parallel Tasks
                            Threads
 Parallel Watch
Shortcuts
Shortcut              Action                    Shortcut

Strg + ,              Navigate To               Strg + Q      Search Menu

F12                   Go To Definition          Strg + K, C   Comment lines

Umschalt + F12        Find all references       Strg + K, U   Uncomment lines

Strg + -              Navigate Backwards        Strg + M, O   Collapse To definition

Strg + Umschalt + -   Navigate Forwards         Strg +M, X    Expand All Outlining

Strg + F              Find in current file      Strg +M, S    Collapse Current Region

Strg + H              Replace in current file   Strg + M, E   Expand Current Region
Break
   Custom snippets

   Debug view experience

   Parallel Stacks

   Parallel Tasks

   Parallel Watch Window

   code analysis

   Shortcuts
What‟s next?
 It‟s   a good century for C++ / native developers
  Single thread performance isn‟t getting much better
  memory latency / bandwidth is the bottleneck
  Efficiency is becoming more important (mobile!)

 There     is a huge commitment towards C++
  Google, Apple started a new compiler project a few years ago (Clang / LLVM)
  ISO standard is evolving more quickly
  C++ Standards Foundation (www.isocpp.org)
    Google, Apple, Intel, Microsoft, ARM, IBM, HP, etc.
Upcoming Standards
   Library in std:: for file system handling
    based on boost.filesystem v3
                                                We are here!
   Net TS
    Networking
    HTTP etc.

   TM TS
    Transactional Memory
Wrap-Up
 Tour   around the new IDE        New    Library Features
 Shell / Window handling           std::async
 Solution Explorer                 PPL
 Code Navigation                   Improved container sizes
 Better Intellisense
 Snippets, Debug Experience
 Parallel Watch, Threads, Tasks

                                   New    Compiler Features
 New    Language Features         Code Analysis
 auto, decltype, lambdas,
                                   /SDL /GS
 override, final
                                   Auto Vectorization
 static_assert, nullptr
                                   Auto parallelization
                                   C++ AMP
Philipp Aumayr
                                software architects gmbh




Q&A                        Mail philipp@timecockpit.com
                           Web http://www.timecockpit.com
                         Twitter @paumayr


Thank your for coming!
                                 Saves the day.

More Related Content

What's hot

Metrics ekon 14_2_kleiner
Metrics ekon 14_2_kleinerMetrics ekon 14_2_kleiner
Metrics ekon 14_2_kleinerMax Kleiner
 
Presentation on Shared Memory Parallel Programming
Presentation on Shared Memory Parallel ProgrammingPresentation on Shared Memory Parallel Programming
Presentation on Shared Memory Parallel ProgrammingVengada Karthik Rangaraju
 
Владимир Иванов. Java 8 и JVM: что нового в HotSpot
Владимир Иванов. Java 8 и JVM: что нового в HotSpotВладимир Иванов. Java 8 и JVM: что нового в HotSpot
Владимир Иванов. Java 8 и JVM: что нового в HotSpotVolha Banadyseva
 
Reactive Qt - Ivan Čukić (Qt World Summit 2015)
Reactive Qt - Ivan Čukić (Qt World Summit 2015)Reactive Qt - Ivan Čukić (Qt World Summit 2015)
Reactive Qt - Ivan Čukić (Qt World Summit 2015)Ivan Čukić
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1Todor Kolev
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1Todor Kolev
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1Todor Kolev
 
EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4Max Kleiner
 
Introduction to llvm
Introduction to llvmIntroduction to llvm
Introduction to llvmTao He
 
The Dark Side Of Lambda Expressions in Java 8
The Dark Side Of Lambda Expressions in Java 8The Dark Side Of Lambda Expressions in Java 8
The Dark Side Of Lambda Expressions in Java 8Takipi
 
Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Max Kleiner
 
Testing Apache Modules with Python and Ctypes
Testing Apache Modules with Python and CtypesTesting Apache Modules with Python and Ctypes
Testing Apache Modules with Python and CtypesMarkus Litz
 
02 c++g3 d
02 c++g3 d02 c++g3 d
02 c++g3 dmahago
 

What's hot (20)

Metrics ekon 14_2_kleiner
Metrics ekon 14_2_kleinerMetrics ekon 14_2_kleiner
Metrics ekon 14_2_kleiner
 
Presentation on Shared Memory Parallel Programming
Presentation on Shared Memory Parallel ProgrammingPresentation on Shared Memory Parallel Programming
Presentation on Shared Memory Parallel Programming
 
Владимир Иванов. Java 8 и JVM: что нового в HotSpot
Владимир Иванов. Java 8 и JVM: что нового в HotSpotВладимир Иванов. Java 8 и JVM: что нового в HotSpot
Владимир Иванов. Java 8 и JVM: что нового в HotSpot
 
Syntutic
SyntuticSyntutic
Syntutic
 
Reactive Qt - Ivan Čukić (Qt World Summit 2015)
Reactive Qt - Ivan Čukić (Qt World Summit 2015)Reactive Qt - Ivan Čukić (Qt World Summit 2015)
Reactive Qt - Ivan Čukić (Qt World Summit 2015)
 
camel-scala.pdf
camel-scala.pdfcamel-scala.pdf
camel-scala.pdf
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1
 
Java findamentals1
Java findamentals1Java findamentals1
Java findamentals1
 
Extending and scripting PDT
Extending and scripting PDTExtending and scripting PDT
Extending and scripting PDT
 
EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4
 
GCC RTL and Machine Description
GCC RTL and Machine DescriptionGCC RTL and Machine Description
GCC RTL and Machine Description
 
Introduction to llvm
Introduction to llvmIntroduction to llvm
Introduction to llvm
 
Introduction to OpenMP
Introduction to OpenMPIntroduction to OpenMP
Introduction to OpenMP
 
The Dark Side Of Lambda Expressions in Java 8
The Dark Side Of Lambda Expressions in Java 8The Dark Side Of Lambda Expressions in Java 8
The Dark Side Of Lambda Expressions in Java 8
 
Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475
 
Smart Migration to JDK 8
Smart Migration to JDK 8Smart Migration to JDK 8
Smart Migration to JDK 8
 
Testing Apache Modules with Python and Ctypes
Testing Apache Modules with Python and CtypesTesting Apache Modules with Python and Ctypes
Testing Apache Modules with Python and Ctypes
 
C#4.0 features
C#4.0 featuresC#4.0 features
C#4.0 features
 
02 c++g3 d
02 c++g3 d02 c++g3 d
02 c++g3 d
 

Viewers also liked

WPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaWPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaRainer Stropek
 
Agile and Scrum Workshop
Agile and Scrum WorkshopAgile and Scrum Workshop
Agile and Scrum WorkshopRainer Stropek
 
Coding Like the Wind - Tips and Tricks for the Microsoft Visual Studio 2012 C...
Coding Like the Wind - Tips and Tricks for the Microsoft Visual Studio 2012 C...Coding Like the Wind - Tips and Tricks for the Microsoft Visual Studio 2012 C...
Coding Like the Wind - Tips and Tricks for the Microsoft Visual Studio 2012 C...Rainer Stropek
 
SaaS, Multi-Tenancy and Cloud Computing
SaaS, Multi-Tenancy and Cloud ComputingSaaS, Multi-Tenancy and Cloud Computing
SaaS, Multi-Tenancy and Cloud ComputingRainer Stropek
 
P/Invoke - Interoperability of C++ and C#
P/Invoke - Interoperability of C++ and C#P/Invoke - Interoperability of C++ and C#
P/Invoke - Interoperability of C++ and C#Rainer Stropek
 
Parallel and Async Programming With C#
Parallel and Async Programming With C#Parallel and Async Programming With C#
Parallel and Async Programming With C#Rainer Stropek
 
Business Model Evolution - Why The Journey To SaaS Makes Sense
Business Model Evolution - Why The Journey To SaaS Makes SenseBusiness Model Evolution - Why The Journey To SaaS Makes Sense
Business Model Evolution - Why The Journey To SaaS Makes SenseRainer Stropek
 
Programming With WinRT And Windows8
Programming With WinRT And Windows8Programming With WinRT And Windows8
Programming With WinRT And Windows8Rainer Stropek
 
Michael Kiener Associates Ltd
Michael Kiener Associates LtdMichael Kiener Associates Ltd
Michael Kiener Associates LtdMichaelKiener
 
Telerik Kendo UI vs. AngularJS
Telerik Kendo UI vs. AngularJSTelerik Kendo UI vs. AngularJS
Telerik Kendo UI vs. AngularJSRainer Stropek
 
Cloud computing was bringt's
Cloud computing   was bringt'sCloud computing   was bringt's
Cloud computing was bringt'sRainer Stropek
 

Viewers also liked (14)

WPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaWPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA Austria
 
Agile and Scrum Workshop
Agile and Scrum WorkshopAgile and Scrum Workshop
Agile and Scrum Workshop
 
Coding Like the Wind - Tips and Tricks for the Microsoft Visual Studio 2012 C...
Coding Like the Wind - Tips and Tricks for the Microsoft Visual Studio 2012 C...Coding Like the Wind - Tips and Tricks for the Microsoft Visual Studio 2012 C...
Coding Like the Wind - Tips and Tricks for the Microsoft Visual Studio 2012 C...
 
SaaS, Multi-Tenancy and Cloud Computing
SaaS, Multi-Tenancy and Cloud ComputingSaaS, Multi-Tenancy and Cloud Computing
SaaS, Multi-Tenancy and Cloud Computing
 
P/Invoke - Interoperability of C++ and C#
P/Invoke - Interoperability of C++ and C#P/Invoke - Interoperability of C++ and C#
P/Invoke - Interoperability of C++ and C#
 
The CoFX Data Model
The CoFX Data ModelThe CoFX Data Model
The CoFX Data Model
 
Parallel and Async Programming With C#
Parallel and Async Programming With C#Parallel and Async Programming With C#
Parallel and Async Programming With C#
 
Business Model Evolution - Why The Journey To SaaS Makes Sense
Business Model Evolution - Why The Journey To SaaS Makes SenseBusiness Model Evolution - Why The Journey To SaaS Makes Sense
Business Model Evolution - Why The Journey To SaaS Makes Sense
 
Programming With WinRT And Windows8
Programming With WinRT And Windows8Programming With WinRT And Windows8
Programming With WinRT And Windows8
 
Michael Kiener Associates Ltd
Michael Kiener Associates LtdMichael Kiener Associates Ltd
Michael Kiener Associates Ltd
 
Vertaalbureau Perfect
Vertaalbureau PerfectVertaalbureau Perfect
Vertaalbureau Perfect
 
Telerik Kendo UI vs. AngularJS
Telerik Kendo UI vs. AngularJSTelerik Kendo UI vs. AngularJS
Telerik Kendo UI vs. AngularJS
 
Sculptura in coaja de ou
Sculptura in coaja de ouSculptura in coaja de ou
Sculptura in coaja de ou
 
Cloud computing was bringt's
Cloud computing   was bringt'sCloud computing   was bringt's
Cloud computing was bringt's
 

Similar to Whats New in Visual Studio 2012 for C++ Developers

Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeDmitri Nesteruk
 
Pragmatic Model Driven Development using openArchitectureWare
Pragmatic Model Driven Development using openArchitectureWarePragmatic Model Driven Development using openArchitectureWare
Pragmatic Model Driven Development using openArchitectureWareMichael Vorburger
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011YoungSu Son
 
Experience with C++11 in ArangoDB
Experience with C++11 in ArangoDBExperience with C++11 in ArangoDB
Experience with C++11 in ArangoDBMax Neunhöffer
 
.NET 4 Demystified - Sandeep Joshi
.NET 4 Demystified - Sandeep Joshi.NET 4 Demystified - Sandeep Joshi
.NET 4 Demystified - Sandeep JoshiSpiffy
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9google
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The EnterpriseDaniel Egan
 
Migration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsMigration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsZvi Avraham
 
Gude for C++11 in Apache Traffic Server
Gude for C++11 in Apache Traffic ServerGude for C++11 in Apache Traffic Server
Gude for C++11 in Apache Traffic ServerApache Traffic Server
 
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]Animesh Singh
 
Smalltalk in a .NET World
Smalltalk in a  .NET WorldSmalltalk in a  .NET World
Smalltalk in a .NET WorldESUG
 
Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application DevelopmentRamesh Prasad
 
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019corehard_by
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1Hajime Tazaki
 
SQL Server - CLR integration
SQL Server - CLR integrationSQL Server - CLR integration
SQL Server - CLR integrationPeter Gfader
 
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...Maarten Balliauw
 
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...Maarten Balliauw
 
Bounded Model Checking for C Programs in an Enterprise Environment
Bounded Model Checking for C Programs in an Enterprise EnvironmentBounded Model Checking for C Programs in an Enterprise Environment
Bounded Model Checking for C Programs in an Enterprise EnvironmentAdaCore
 

Similar to Whats New in Visual Studio 2012 for C++ Developers (20)

Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/Invoke
 
Pragmatic Model Driven Development using openArchitectureWare
Pragmatic Model Driven Development using openArchitectureWarePragmatic Model Driven Development using openArchitectureWare
Pragmatic Model Driven Development using openArchitectureWare
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 
Experience with C++11 in ArangoDB
Experience with C++11 in ArangoDBExperience with C++11 in ArangoDB
Experience with C++11 in ArangoDB
 
.NET 4 Demystified - Sandeep Joshi
.NET 4 Demystified - Sandeep Joshi.NET 4 Demystified - Sandeep Joshi
.NET 4 Demystified - Sandeep Joshi
 
Linq 1224887336792847 9
Linq 1224887336792847 9Linq 1224887336792847 9
Linq 1224887336792847 9
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
 
Migration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsMigration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming Models
 
Gude for C++11 in Apache Traffic Server
Gude for C++11 in Apache Traffic ServerGude for C++11 in Apache Traffic Server
Gude for C++11 in Apache Traffic Server
 
The Style of C++ 11
The Style of C++ 11The Style of C++ 11
The Style of C++ 11
 
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
Hybrid Cloud, Kubeflow and Tensorflow Extended [TFX]
 
Smalltalk in a .NET World
Smalltalk in a  .NET WorldSmalltalk in a  .NET World
Smalltalk in a .NET World
 
Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application Development
 
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1
 
SQL Server - CLR integration
SQL Server - CLR integrationSQL Server - CLR integration
SQL Server - CLR integration
 
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
 
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
 
Sadiq786
Sadiq786Sadiq786
Sadiq786
 
Bounded Model Checking for C Programs in an Enterprise Environment
Bounded Model Checking for C Programs in an Enterprise EnvironmentBounded Model Checking for C Programs in an Enterprise Environment
Bounded Model Checking for C Programs in an Enterprise Environment
 

Recently uploaded

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Whats New in Visual Studio 2012 for C++ Developers

  • 1. Philipp Aumayr software architects gmbh Web http://www.timecockpit.com Mail philipp@timecockpit.com Visual C++ 2012 Twitter @paumayr Improvements over 2008 Saves the day.
  • 2. Intro  DI Philipp Aumayr  Senior Developer @ software architects (time cockpit)  9-5 -> C#, 5->9 C++, 24/7 VS 2012  Twitter: @paumayr  Blog: http://www.timecockpit.com/devblog/
  • 3. Motivation  Visual Studio 2012 improvements over 2008 New Shell New Editor Better Intellisense Unit Testing Code Coverage Code Analysis #include completion Navigate To Type visualizers
  • 4. Motivation  C++11 New standard released August 12, 2011 Major overhaul Bjarne Stroustrup: „C++11 feels like a new language“ Visual Studio 2012 has partial support Is updated out-of-band (November CTP adds major language parts) auto, decltype, range-based for loop lambdas, explicit overrides, static_assert nullptr, enum classes, move-semantics, variadic templates, initializer_lists, delegating constructors, explicit conversion operators
  • 5. Motivation  STL improvements shared_ptr, unique_ptr unordered_set, unordered_map SCARY iterators + container sizes  Move Semantics  std::async  Code Analysis  SDL
  • 6. Motivation  Auto-vectorization  Auto-parallelization  C++ AMP A lot to learn, but well worth the effort!
  • 7. IDE Improvements  Multi-monitor support Rewritten in WPF and MEF  Improved responsiveness Intellisense works in the background Asynchronous project loading  Editor Zooming  Navigate-To  Call Hierarchy  Demo
  • 8. IDE Improvements  Preview tab  Pinned editor windows  Ctrl + Q / Search Menu  New Solution explorer Scope to this multiple views  Find within editor  Find all references  Demo
  • 9. Test Framework  Supports writing unit tests for MSTest Test adapters for other test frameworks are available Gtest xUnit++  Test Explorer Window Grouping  Code Coverage  Demo
  • 10. Better Intellisense  Uses an SDF (SQL CE database) instead of the ncb  Faster  More robust  Demo
  • 11. Type Visualizers (Natvis)  Allow customizable data representation in debugger Replaces autoexp.dat Easier to handle, more powerful  Create a natvis file Place in either %VSINSTALLDIR%Common7PackagesDebuggerVisualizers (requires admin access) %USERPROFILE%My DocumentsVisual Studio 2012Visualizers Or VS extension folders  Files are reloaded at every debugging session No restart required when changing natvis files
  • 12. Type Visualizers (Natvis)  Example natvis file  Allows conditional strings, node expansions, item lists, tree items, synthetic items, etc.
  • 13. Break New Editor Better Intellisense Unit Testing Code Coverage Code Analysis #include completion Navigate To Type visualizers
  • 15. C++ Styles (Question) C with a C++ compiler? C with classes / inheritance?  RAII, Exceptions, Smart pointer?  STL?  TMP?
  • 16. auto  Automatically deduces type information Very similar to „var‟ in c# Reduces amount of typing required  Reference or Value? Value by default, add & to make it a reference  Demo
  • 17. decltype  Represents the type of the expression decltype(2*3) -> int decltype(a) -> type of a  Why? Let types flow!  Demo
  • 18. Range based for loop  New type of for loop  Iterates all members of a collection  Demo
  • 19. Lambdas  Anonymous Functions  Allows logic to be placed where required  Can capture environment  General syntax: [capture](parameters)->return-type{body}  represent by type std::function<>
  • 20. Lambdas  Finally make STL algorithms useable  Reduces amount of (boilerplate-)code No more functor classes!
  • 21. Lambda Captures  A Lambda can capture environment Allows the lambda to access and modify state  Capture kinds - reference or value - automatic or specific  Demo
  • 22. override and final  Explicitly defines overrides Compiler helps if no method to override is found  Helps with refactoring Rename method in base class but not in derived -> derived method no longer overrides Base class from third party!  Helps class design Implementers of derived classes can more easily understand which methods to override  final can be used on classes to prevent being derived from  Demo
  • 24. static_assert  Tests a software assertion at compile time  Especially useful for portable code Assert size of specific structures (x86, x64 issues)  Check library versions  Used to be accomplished using the preprocessor  Demo
  • 25. nullptr 0 / NULL used to indicate a null pointer  nullptr is of type nullptr_t  implicitly assignable to any pointer  not assignable to int etc.
  • 26. enum classes  C++03 enums Not type safe Enums of different types can be compared (basically integers) Storage type int  C++11 enum classes Type is compared as well! Underlying type can be chosen
  • 28. enum classes  C++11 enum classes
  • 30. Initializer lists (CTP)  Eases construction of non-POD types  Finalversion will provide initialize list constructors for STL types  Binds {…} syntax to the std::initializer_list<T> type.  Current STL does not support it  Demo name == “class std::initializer_list<int>”
  • 31. variadic templates (CTP)  Flexible number of template arguments  Usable for template writers n-ary structures (tuples) e.g. make_shared, make_tuple Example: saveprint  Beware of dragons ;)  Demo
  • 32. Move Semantics  C++03: many (temporary) class instances Resulted in a lot of copying Constructs to work around Passing complex data structure from function  C++11: Move semantics If the copied value is an rvalue reference, the move constructor is called
  • 33. Move Semantics  Dramatically changes style! C++03 C++11
  • 34. Move Semantics  Note: right-hand version is valid C++03 code! But advanced programmers avoided it, due to the extra copy involved.  Now with C++11: Elegant AND Fast Reconsider the patterns you are used to  All STL containers implement move semantics Returning container was unavoidable? -> automatic performance improvement!  STL code will have fewer temporary objects  Demo
  • 35. Break  C++11 auto, decltype, range-based for loop lambdas, explicit overrides, static_assert nullptr, variadic templates, initializer_lists, enum classes, move-semantics
  • 36. std::async  C++ 11 has built-in support for asynchrony available through <future> header  std::async<T>(std::function) returns a future<T> - Different launch policies (synchronous, asynchronous) - can be waited on using wait() or get() to retrieve the result  Implemented in VC++ using PPL (parallel patterns library) - Highly scalable and performant
  • 37. std::async  Not every asynchronous operation is a thread / cpu bound Notably IO requests User Input etc.  std::future<T> can be created from a std::promise<T>!  std::promise<T> acts as a provider for a future Marshalls result between threads of execution correct locking / etc. Provides set_value / set_exception
  • 38. std::async T1 T2 (Blocks) Demo
  • 39. Parallel Patterns Library  Based on ConcRT  Compatible to Intel Thread Building Blocks (TBB) At least interface wise  Template Library for parallel programming Abstracts concurrent workflows into tasks Provides continuations (improvement over std::future<T>)  Demo
  • 40. Auto Vectorization  Modern CPUs support SIMD Single Instruction Multiple Data Extensions such as SSE and AVX Usually optimized for specifically using compiler intrinsics or inline assembler Serial Vector x = x1 + x2 xyzw = xyzw1 + xyzw2 y = y1 + y2 z = z1 + z2 w = w1 + w2 τ
  • 41. Auto Vectorization  VC++ 2012 compiler has an auto-vectorizer (-Qvec) Tries to automatically vectorize loops and operators Enabled by default Diagnosis output using /Qvec-report:2  Performance difference? Depends. Max 4x for SSE (128bit), 8x for AVX (256bit), 3x-4x typical  Demo (later with auto parallelization)
  • 42. Auto-Parallelization  To utilize multiple cores, parallelization is used (MIMD) Multiple-Instructions-Multiple-Data  VC++2012 has an auto-parallelizer Can be hinted #pragma loop(hint_parallel(N)) #pragma loop(ivdep) Enabled using /Qpar Diagnosis using /Qpar-report:2  Demo
  • 43. C++ AMP  Open specification created by Microsoft  C++ for GPGPU Massively Parallel / Vector programming Based on top of DirectCompute (windows) Clang / LLVM implementation using OpenCL is available Provided by Intel (“Shevlin Park”)  One new keyword Restricts the decorated function to a specific subset of c++  Template library for wrapping data structures Datatransfer to/from GPU etc.
  • 44. Why C++ AMP?  Directly available from the compiler No additional SDK required Can reuse types (vector2f e.g.)  Better debugging experience compared to CUDA / OpenCL!  Makes C++ applicable to heterogeneous computing A processor may consist of multiple cores of different flavor More energy efficient (mobile!) visual computing image morphing Augmented reality etc.  Demo
  • 45. Smaller container sizes  X86 release, sizes in bytes Container VC9 SP1 / SCL = 0 VC10 (2010) VC11 (2012) (2008) vector<int> 16 16 12 deque<int> 32 24 20 forward_list<int> N/A 8 4 queue<int> 32 24 20 stack<int> 32 24 20 unordered_map<int, int> 44 44 32 string 28 28 24 wstring 28 28 24 ~14% less!
  • 46. Smaller container sizes  x64 release, sizes in bytes Container VC9 SP1 / SCL = 0 VC10 (2010) VC11 (2012) (2008) vector<int> 32 32 24 deque<int> 64 48 40 forward_list<int> N/A 16 8 queue<int> 64 48 40 stack<int> 64 48 40 unordered_map<int, int> 88 88 64 string 40 40 32 wstring 40 40 32 ~20% less!
  • 47. Code Analysis  Static analysis  Provides warnings at compile time  Additionally to /GS and /SDL  Detailed information on warning
  • 48. Code Analysis  What does it check ? Uninitialized Reads HRESULT verification checks Concurrency Warnings Format string checks Correct destructor calls (delete[] vs delete) Redundant code checks Many more: http://msdn.microsoft.com/en-us/library/a5b9aa09.aspx  Custom code can be annotated to aid code analysis See http://msdn.microsoft.com/en-us/library/ms182032.aspx  Demo
  • 49. Break  std::async  ppl  auto vectorization  auto parallelization  container sizes  code analysis
  • 50. Custom Snippets  .snippet is supported, same as C# XML file describing a code snippet Declare variables and use them in the snippet body  Very helpful for similar but not equivalent code  Demo
  • 51. Debug View  Pin watch to source code Add comments Not only variables, but (most) expressions  View values from last debug session  Export / Import Data Tips Makes it easier for debugging with multiple developers / on different machines  Demo
  • 52. Parallel Stacks Window  New view for debugging  Better understanding of multi thread applications
  • 53. Parallel Tasks Window  Lists the task queues
  • 54. Parallel Watch Window  Watch expressions in parallel Especially useful in tight loops Data races Expressions Can freeze / thaw threads Manually verify locking  Demo Parallel Stacks Parallel Tasks Threads Parallel Watch
  • 55. Shortcuts Shortcut Action Shortcut Strg + , Navigate To Strg + Q Search Menu F12 Go To Definition Strg + K, C Comment lines Umschalt + F12 Find all references Strg + K, U Uncomment lines Strg + - Navigate Backwards Strg + M, O Collapse To definition Strg + Umschalt + - Navigate Forwards Strg +M, X Expand All Outlining Strg + F Find in current file Strg +M, S Collapse Current Region Strg + H Replace in current file Strg + M, E Expand Current Region
  • 56. Break  Custom snippets  Debug view experience  Parallel Stacks  Parallel Tasks  Parallel Watch Window  code analysis  Shortcuts
  • 57. What‟s next?  It‟s a good century for C++ / native developers Single thread performance isn‟t getting much better memory latency / bandwidth is the bottleneck Efficiency is becoming more important (mobile!)  There is a huge commitment towards C++ Google, Apple started a new compiler project a few years ago (Clang / LLVM) ISO standard is evolving more quickly C++ Standards Foundation (www.isocpp.org) Google, Apple, Intel, Microsoft, ARM, IBM, HP, etc.
  • 58. Upcoming Standards  Library in std:: for file system handling based on boost.filesystem v3 We are here!  Net TS Networking HTTP etc.  TM TS Transactional Memory
  • 59. Wrap-Up  Tour around the new IDE  New Library Features Shell / Window handling std::async Solution Explorer PPL Code Navigation Improved container sizes Better Intellisense Snippets, Debug Experience Parallel Watch, Threads, Tasks  New Compiler Features  New Language Features Code Analysis auto, decltype, lambdas, /SDL /GS override, final Auto Vectorization static_assert, nullptr Auto parallelization C++ AMP
  • 60. Philipp Aumayr software architects gmbh Q&A Mail philipp@timecockpit.com Web http://www.timecockpit.com Twitter @paumayr Thank your for coming! Saves the day.

Editor's Notes

  1. Snap window back to original: Ctrl + Double click headerPromoting Preview Tab -&gt; Ctrl + Alt + Home (Pos1)
  2. Promoting Preview Tab -&gt; Ctrl + Alt + Home (Pos1)Show Themes (Dark / Light)
  3. Demo: Open VC2012 solution, add a few Assert::Fail to make testing more interesting. Show what test classes are
  4. Demo: Open up Ogre SDK -&gt; show that included Ogre.h works for intellisense
  5. [HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\11.0_Config\\Debugger]&quot;EnableNatvisDiagnostics&quot;=dword:00000001
  6. [HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\11.0_Config\\Debugger]&quot;EnableNatvisDiagnostics&quot;=dword:00000001http://msdn.microsoft.com/en-us/library/vstudio/jj620914.aspx
  7. VC2012:TestAuto, TestAuto2, show types in intellisense
  8. Demo: TestDeclType, show types of variables using hover
  9. Demo:TestRangeBasedForLoop, TestRangeBasedForLoopArray, TestRangeBasedForLoopCustomRange
  10. Demo: TestLambdaFunctionAdd, TestLambdaFunctionCaptureValue, TestLambdaFunctionCaptureReference, TestLambdaFunctionMultiCapture, TestLambdaFunctionPassToFunction
  11. Demo: TestLambdaFunctionAdd, TestLambdaFunctionCaptureValue, TestLambdaFunctionCaptureReference, TestLambdaFunctionMultiCapture, TestLambdaFunctionPassToFunction
  12. Demo: TestInitializerList
  13. Demo: VC2012CTP.cpp
  14. Demo: TestMoveConstructor
  15. Demo: TestAsync, TestPromise, TestTaskPPL
  16. Demo: TestTaskPPL
  17. Demo: VC2012 -&gt; main.cppQvec / Qparmessages http://msdn.microsoft.com/en-us/library/jj658585.aspx
  18. Demo: VC2012 -&gt; uncomment AMP
  19. http://msdn.microsoft.com/en-us/library/a5b9aa09.aspxDemo: ArrayOfByOne, RedundantCodeCheck
  20. Intvector.snippet, debugging support
  21. Demo: break in TestAsync