>> We're about to get started. Hello everyone.  Welcome.
Welcome.  Thank you for coming to this session.  This is going
To be a session all about
C++. If you
Are coming from and want to learn the newest latest update or this session is tower
You if you are a slides developer and have never visual
Studio and want to get started today.  My name is marion and i
Am the program manager for mic microsoft c++.  If you don't
Have any clarifying questions that you would like me to answer
Please look me up on twitter and ask questions.  If you want a
More private medium that might
Handle at microsoft.Com.  We will talk about what is in the
Compiler and libraries, how it is easy to
Upgrade.  And move to improvements in past updates and
Boosting productivity that you are getting by upgrading to the
Latest version.  There is a lot of content to be covered because
Really, last time we shipped in march, we had more than seven
Updates coming in.  The 15.8 Preview one is also out today
With a lot more feature that we look at for your feedback.  So
Not everything fit in into this presentation.  And if there are
Features that i'm not going to talk about today they talked
About last year in build that is the same name as the session
Today and while that session is not a prerequisite for this one
I recommend you check it out. Those peters that are in there
Are still cool and still in the product today.  As you can see
We have been beside at the beginning of this year as well
With already three updates and there is also something else
That happened in 2018 they would like to quickly talk about.
Visual c++ is 25 years.  And right now i want to take you
Through a quick journey over the history and we're going to go
Back and go back.  And goa back
All the way to 1993 i have a clip from visual c++
2.0 Launch. >> [ Video playing ]
There you go a fully functional
C++ application.  Ladies and gentlemen that was
C++. >> Nice t-shirt.  We still have
A few left.  How many of you noticed the orchestra over
There.  That is the kind of backup they will take for my
Presentations in the future. C++ is subsequent releases
Changed the perception of how we define productivity for c++
Development.  It's impressive and humbling to go back to the
History and look at the technical challenges that the
Team had to solve over the years.  There are thing right
Now that we take for granted in our day-to-day job.  For
Example, the compilers, for example, mfc class wizard
Or the c++ debugging containers and
Visualizers.  Those are challenging things to be done at
The time.  And i want to move on to the future and we're really
Excited about the next 25 years but for now i'll say happy
Birthday c++. [Applause] all right.  There is one thing
In our 25 years history that we were never able to claim.  Any
Guesses what that is? there is something, yes.  They
Were never able to claim, until this week.  So we're announcing
Today that we have added c++ 11, 1417 compiling features and we
Have the most c++ library implementation in the market so
With that visual studio achieves c++ performance.  This has been
One offer top priorities for the past six years and has been huge
Engineering effort including the rejuvenation of our
Compiler. And matches expression, and
Return those are things i have
Been working with the team for the past six years so can we
Give a round of applause? thank you. [Applause]
>> This has been our top priority for the past six years.
I need to clarify that our top priorities will not change.  We
Are still committed there is always new c++
Standards to improve and bugs
To be fixed. One of the reasons you should be
Using c++ is you can write code, with the update 15.7 It's one of
The oldest features that we have been talking about in c++ 17 and
I want to take a brief moment to talk about the switches that
Enable conformance.  Permissive is a less permissive mode that
Enables some of the functionality that being be
Breaking for code bases that have been written in the past
With our more relaxed implementation of our
Compiler. For example, look up will be
Behind the switch.  The reason we created permissive is to
Allow companies to get used to our progresses and while still
Related to the performance adopter to do it at their own
Pace if you start doing it today, all the templates you
Will start with today.  But if you are moving from a large code
Base this could take a while because there is a lot of things
That will need to be more precise in the way you write
Your code.  I am going into details of switches which are
Obvious of what they actually do but the theme of the slide is
You can adopt the standard at your own pace.  C++ is the
Default right now in our id but if you want to change just
Change to c++ 17 and if you want to move to all the experimental
Features on technical specifications for the latest.
If you want to learn more about how to modernize your code,
Please, i hope i didn't miss the
Talk yesterday i hope you did and master the time travel
Skills the recording will be available.  He went into detail
About how to modernization the code.  We do have c++ core
Guidelines helpers inside visual studio as well the guideline
Support library is technology based on our static analysis
Tools that will allow you to write modern code.  I went into
A lot more details last year please check out my talk from
Last year.  Conformance should not be the only reason why you
Use the ms tool set for targeting windows, you can --
The tool set brings improved diagnostics superior
Performance, reliability faster output as well as security tools
That are required to build those modern applications for example,
We compile your code and in a
Lot of optimizations kick in and improve run time code.  And also
I have a list of security tool that you should use at every
Step of your development cycle but i will make a special
Mention of q spector which is msbc aid in helping you mitigate
The spector of vulnerabilities that were announced.  I am sure
You all know about it. If you're concerned about how you
Will acquire these tools, don't be.  Rest
Assured that visual studio 17 comes with experience
And let's you within 12 minutes install everything you need to
Get started with c++ development.  And you don't need
Any bloat aware any additional
Languages that you don't actively use.  We have three
Mobile work loads, linux and game work load so you can
Customize your installation and add the c# sharp and any other
Work load as well.  And something i want to call out is
That in addition to the release channel where we release every
Two or three months if history is an indication we haven't
Committed to the timeline, but in addition is a preview channel
Where we update more often and these are features that are
Still being kidnapped developed
So i encourage you to install
Previews it works side by side with
The release installation so it shouldn't affect it at all.
And the pain free upgrades.  We definitely want to make sure if
You are coming from 2015 there is an easy migration to
17 If you want to use the
Leiries you can add to the even
If you are in the 17 set you can update.  Always trying
To push forward to update as we reach the compiler but for some
Companies that may not be an option.  So you can update with
The specific update versions of our compiler.  And when you're
Ready to move to the latest compiler keep in mind that you
Also have the compiler switches to enable performance that you
Can pay as you play.  Enable more and more of the performance
Features like the permissive minus, the c++ as you mentioned
Earlier.  The biggest problem that we hear from customers when
They upgrade are the third party libraries that are built into
The older version and keeping them hostage on 2015.  What we
Did in 17 for the first time ever is binary compatibility.
What this means is that the third party library that you
Depend on can stay in 2015 until they also migrate to 17 but your
Code base can update and when you link it together it will
Just work. [Applause]
Now, can you do that for open source libraries as well.  If
You already have compiled with 2015 but there is a better
Option.  We released two years ago a package which is an open
Source library manager it allows to you acquire up to 900
Libraries, i think we're at right now, and this is the way
You can abstract away all the complexities that the open
Source libraries bill systems have and consume those libraries
In a consistent manner so you don't have to worry about you
Migrating from version to version.  Now we're going to
Switch gears a bit and talk about -- we talked about the mfc
Compiler, talked about libraries and windows but not everybody
Targets windows and not everybody uses them as mfc
Compiler.  If you are in that group we still want you to use
Visual studio. And here
Is why. A single instance through remote
Builds you can target all the platforms that you need you
Don't have to go to a different operating system to target that
System.  Everything is done for you inside the comfort of the
Visual studio id we want to make it simple that people are coming
And bringing that bases don't have to move to ms build don't
Have to create solution surrogates they can just point
Into a folder and visual studio picks up all that information
And makes it work.  What does it mean making it work?
Enabling all the rich c++ function that you are familiar
With in visual studio. Debugging, intellisense,
Browsing all those features are available even though you're not
Using them as build project.  An important note, it's not only
About taking advantage of the visual studio productivity that
We want to offer it's also taking advantage of the tool
That you use in your day-to-day job inside visual studio so
We're working on and enabling more and more, if you are using
A different compiler you should have a great experience.  If you
Are using any new test framework out there you should still be
Using it with visual studio and recently we added support for
Form formatting as well.  I will demo that in a bit but before i
Do i want to talk about an announcement we made this month
Pertaining to this topic.  Bc package which is the package
That was mentioned earlier is now available for linux and mac.
This means that you can acquire all c++ library in a consistent
Manner.  From the today we announced we have 350 libraries
Available and to put things into perspective two years ago when
We announced pc package for windows we only have 20.  That's
A testimony of the contributions we have been getting over the
Years it was an amazing effort and i thank you community for
Adding all this in.  You can learn more on that page over
There but let me actually show
You. So
What i have here, i'll just
Bring in this, i'll go to open a project that i have, it's a
Sample. Sml sample called pong
And when i hope the cmxd from the open menu you will see that
This is a simple list xt that has dependence on html and it
Has a target called pong and this is a source code of that
Game.  And now i have two options really, one option is to
Go and download the sfml binary library that someone built on
The internet or i can learn how to build it from source i don't
Need to do that because it is available in the package library
And what i did here is run the package and there is a much
Longer building time.  And the next was package install what
This does is connects the package with all the
Installations on the machine for ms build projects but it comes
With support for projects.  Now it invokes automatically that's
The support we built in so i'm going to go to the cmeg menu and
Change settings.  As you can see i added the c message setting
Over here.  You should see the
Output refresh.  It's really
Coming from the package include folder and that's all i had to
Do.  If i go to cmeg and do build all my project builds as
You can see generating a binary and i am ready to debug it.  So
To debug it i know this is not going to work because it needs
To load some resources so in addition hitting five i will
Need to set working directory of bugging to workspace.  I will
Click here and debug and launch set offings and change the
Settings for my target they want to debug.  I'll just add
Directory -- root.  Hit f five.
The game will start, and while i was practicing for this i
Probably should have practiced more.  I played a lot more and i
Was never able to win so we're not going to try that today.
What we're going to try today is make this work on
Line you can
See the same exact commands they ran on windows i run in the
Package on ml and it shows me all of the dependencies of sfml
That the package brought in i didn't have to worry about that
At all then i ran package install to get the c commands.
Which this does is configures package to be code and it can
Pick up all the headers.  So what i need for my cmeg project
Is take this, which has a linux integration and go back to my
Cmeg and go back to change settings.  Scroll down to the
Linux configuration and add this line over here.  I'm going to
Switch to the linux debug configuration now.  And you can
See that what visual studio does copies the file remotely to a
Linux machine, it runs a configure and find in the remote
Package folder because i told it to with my cmeg file and i can
Also ready to build it let's run cmeg build all.  Let's see if it
Builds.  And i have a binary. So now i know for a fact, again
That this binary is not going to run on line
.  I go to my remote machine and find out the number
Of the display which is 0 now i'm going to condition figure
The debug information and i'm going run
Configure the pong linux project for debugging.
Yes i do want to reload in addition windows configuration i
Have an i need to change the debug command.  Export, display,
And this is the process i'm
Launching.  I hit f
Run. You see it running over here and
Just to prove this is working i'm not going to search for you
Win, i'm going to search for you lose.  And we're about to see
That this is actually -- aaah, i lost.  This is a real debugging
Session.  Now if i really want to explore and evolve the sample
I do want intelligence and you can see i have some squiggles
Here.  This happens, and if you go to visual studio and change
Some environment variables it will take some time for visual
Studio to refresh we have a background that goes around and
Checks for changes in the system and if you want to rush it if
You know you made something that visual studio is not aware you
With go to project and refresh
The environment.  In the future update during the rescan
Solution we made it for linux as well.  What happens when i click
Here you can see i have a manager that will go remotely
And scan all the files from the linux machine, and it will bring
Any changes that happen in the remote environment into the
Intel sense engine.  It already has an intelligence is
Refreshing and they're fen that's all i had to do.  I have
Full intel sense, and if you look at the path it's coming
From my pc package installed 64 linux environment.
All right.  So now this is how you take advantage of all the
Productivity features made few
Changes and opened it up.  As i mentioned earlier it's not only
About using the best features of visual studio for development
It's also using the existing tools you're already using
Frameworks, compilers, and
Formatting tools, as well as visual studio without having to
Drop on the command line to use all those tools.  And that's
Particularly important especially when you are working
In a larger project.  When you are working in a larger team and
There requirements.  I will
Switch to a project they have here, and it's an open source
Library available and my virtual team tasked me to investigate a
Test this is the test in question over here and it's
Supposedly fails.  So now this is a c test the way i would do
It i would probably figure out what is the command line to
Launch of the test and run it in visual studio.  It works but i
Don't have to do that.  With visual studio i can see all the
Test in test explorer and run it from there without having to
Interrupt my workflow.  I can click and run to see if there is
Any other test potentially failing this one might fail.
And visual studio will run in the background and while we run
That let's get more familiar with this particular test.  I go
To definition in this one that seems most important and it
Brings in another file, and in the cmeg target.  This was not
Evident when i was looking at the disk few.  There was just
One file there.  And now what i need to do is maybe go to the
Cmeg to see what other file it brings to understand what's
Going on with my test.  Not anymore.  In 15.7 We added a new
Cmeg target view to get all the information you need to get the
Cmeg projects that you have in your solution.  If i run here
You can see the fullest targets, the active and debug target is
Here if you are familiar with solutions and project view and i
Expand it i get a lot more information with what's going
On, i can see the records being brought in.  It's more than just
The files the files are listed here and yes there are a lot
More files brought in here even more than the one i was opening
Here.  I can bring in the target, i can build it rebuild
It and in 15.7 We also added support for code analysis.  So
We can software analysis directly on the cmeg target.
And if i'm on a single file we also enable compile file you
Don't have to build the whole target, you single file compile
And get the result and move forward eventually you are going
To do a full build but you don't want have to do it first.  You
Can see the specific test failed and that's the one they was
Going to investigate and let's see the description over here.
It says that the duration has to be more than four and it
Actually takes only two seconds. I know exactly how i'm going to
Fix this. All right.  So stop
Right there.  Let me explain what just happened visual studio
Does automatic formatting and when i do close curly or i do a
Semicolon it turns.  You have to realize in my project over here
I have a format file and it's telling me hey i'm about to do
Formatting automatic formatting honoring the formatting that's
In the file.  Why does it work? we found there is a lot of
People that have been having format files in their folder for
A long time and have been ignoring them just like visual
Studio ignores them, now we're going to use different settings
But if you don't like them can you go to tools options by
Clicking that link and disable formatting and go back to
Previous behavior or can you go to manual operations not
Automatic and if you are on the opposite end of the spectrum,
Just change to one of the default build
Formatting styles that it comes with.  Let's go
Back to me typing and fixing this test.
What's going on here? i see a squiggle and it's not a
Red squiggle. It's a purple squiggle and what
It tells me is that hey, i know you're developing for windows
Right now but you happen to have also a linux configuration
Configured here and what happens with linux configurations is
That it doesn't work.  I talk to developers on cross-platform
Development and i hear the most interesting way that they make
Their team validate cross-platform development there
Is always people who forget to build for different platforms
And there is a process to get them to build for the others.
You don't have the to do that visual studio helps you by
Bringing the information inside your editor.  So visual studio
Complaint busy this fix maybe i'm going to evaluate my life
Choices and make a better fix let's delete this right now and
I think the right fix right here is this should take less than
Four four seconds.  I don't have to
Use it all the time to be able to run my test.  We brought in
The information of the test runs inside your editor so it can run
And debug those tests so i can do run now and the test should
Now complete.  It will rebuild it will run the target bring in
The information back into my editor.
All right.  So in this demo, you have seen me start from a very
Basic sample and configure running both windows and linux
And you have seen me work with the tools of choice.
Integrated, and for cmeg you can use as generators and there is a
Lot more support coming as well. So now i can switch to the
Slides. And really quickly, these are
Summary slides i'm going to go fast this is the stuff i already
Showed you.  The theme is we want to make sure that visual
Studio open folder experience that we added in 17 is the entry
Point for every cross-platform developer it's easy on enable
And configure with the visual studio experience and if you
Want to see in demos that are not cmeg for open folder that is
Fully supported you should go back in time at 9:30 this
Morning and check mark and will's demos.  For cmeg this is
The most popular c++ platforms out there and we have built this
On top of open folder because that is the kohs platform
Development and we are making it as seamless as possible for you
To be productive inside visual studio.  And as you see, it's
Very simple, once you are started inside visual studio to
Target linux.  The requirements on the remote machine that you
Have are very slim just to have an ssh really and a building
Environment set up on that machine and as you are getting
Set up you can use, if your projects are coming from windows
And they have ms build product
You can use and you can use linux and cmeg and i also
Mentioned that in 15.8 The support for remote intel sense
Is coming so that is our goal to make the linux side as easy as
It is to target windows.  And speaking of productivity what we
Are going to be doing next is dive deeper into that but we
Cannot start with productivity we have to talk about
Performance.  Because the goal is to get out of the way as soon
As possible and then as you are in the inner loop of
Debug ging,
We is respond as fast as you can.  We are achieving this with
17 More so than with any other previous release.  So as you can
See here, if you c++ project load, that it's got 4,000
Projects.  We already have cut the time of loading the project
And parsing the c++ code in it to build a fully grown database
To provide any symbol navigation in half in more than half
Actually what we're talking about is improvements of
Magnitude not tiny improvements that's why we want all of you to
Be using 17.  This gets more exciting the second time you
Load a project.  Because now we have everything completed,
And the carbs are built it takes
Faster than the previous release.  Last year we showed
You this number as well but i want to tell you this was 17x
Last year when i showed you and the big point is that we didn't
Stop there we kept going and we'll never stop with
Performance that's the promise i'm going to make you.  Memory
Usage is also dropped and this gets even more exciting when we
Talk about debugging scenarios. So when you are doing a
Debugging session in 2015,
You're coming dangerously to the four gigabytes barrier there
Were times where you weren't able to debug.  That's vastly
Improved in this release, to be more respectful of the memory
And it's a lot faster in run time.  Those are not the only
Areas we focused on, and find our references and rename fact
Are also seeing in the improvements and call out to the
Engine community, unreal engine and using the feedback please
Keep the feedback coming.  The improvements we made there apply
To everyone else as well.  So thank you.
And speaking of an unreal engine, let's talk about bill
Through put.  So microsoft has been working and been in contact
With triple a games companies in the past to better understand
The build through requirements in a real-world case and
Setting.  Here i'm highlighting two that shall remain nameless
For now but i am sure it has nothing to do with how happy we
Are with the tools.  In 15.7,
That shipped this week, there is significant improvement in the
Way we process pdbs and the context of msbd serve so if you
Are using/e lower i switches which are the default
Configuration you are going it see this type of benefit.
This huge code base difference.  It's
Not full build.  It's incremental build.  If you
Change files and you can't wait to hit your break point what
Happens here is that combining those pdb improvements with what
I mentioned earlier in debug fast link we can speed up more
The debug fast link remember when you didn't have debug fast
Link on to turn it on you have a four x improvement with it on if
You move to 2017, 15.7 You get further improvement in your
Incremental building.  Now i should mention though that we
Work closely with this triple a game engines and we did further
Improvements to build process by changing some of the switches
We're not really comparing apples to apples there is a part
Of it that everyone gets for free and additional tweaks that
We made to build processes to get extra performance and we
Documented all those changes and if you go to akms through put
You get highlights on benefits as well so i do recommend
Checking out this h all right and now i think we're ready to
Talk about productivity some more.  And what better way to do
That than with a demo. So let's go back to my
Computer over
Here. This demo picks up
Last year where the demo of the same name left off.  I opened
Code navigation, all those features are still in there and
They rock.  I ended the demo with the announcement that we're
Integrating google test inside the test explorer and i ran i
Test and that was the rap of the demo we did a lot of progress
Testing so you see the code lens and support for support pop up
And we added boost test as well as supported scenario and now in
This demo i'm in the process of migrating from google test to
Boost test, my test, for no good reason other than show you that
It supports both of them and it's not going to make any
Opinion about what you should be using.  So if you go back,
Tomorrow, and start changing your test framework that the
Team uses visual studio will be able to run both.  Your team may
Have some objections to that but as you can see here visual
Studio runs all of those with no problem and in the same session
Really.  Let me open this file over here and what you see is
Again, the code lens view of every test they run directly in.
So i can go over here i can see
The details and run to debug this test.  That's pretty cool.
There is more things to show in here.  And there are some green
Squiggle that pop up over there probably you are not used to
Them.  For the purposes of this demo the density of the green
Squiggles have been increased but i promise they are coming to
A code base to you soon this is something we're working on 15.8
What this does is run code analysis in the background for
The file that you have open in the editor and brings in that
Information of all the security analysis we do, code correctness
And the core checks that we do for c++ guide lines support
Brings it inside the editor so it helps you with the file that
You can actually make a difference rather than going to
The build process and building all your files and project
Statistic analysis and getting a slew of errors of things you do
Not plan to tackle.  These are the files that can make a
Difference it is an opportunity, not a challenge.  These are
Things that you are going to see, for example, a member was
Missed and initialized the automatic overflow happened in
That operation or can you turn this onto context.  And it has a
Fix it.  That's the only fix it i have for static analysis
Today.  Basically context for all the things is something that
We're after.  And then for this one, there is always going to be
Some static analysis warnings that we're never going to be
Able to fix you need to go back and tell us what were you
Thinking in writing that code so for this one let's say i want to
Fix it.  And to refresh the static analysis you do run code
Analysis on file this will run code analysis and refor status.
It will run but is still on demand.  So let's move to the
Next test to see if it actually passes so i can click run over
Here.  And i can move to the next test.  The next test uses a
Lot more macros.  So that's not nice.  And it fails.  I can
Click it and see this statement failed.  It's either the result
Of this macro called sphere value or the function call.
Let's delve in it goes to definition and you can configure
To go to definition and keep going and going, and then can
You go back and try to wrap this macro in your head of what it
Actually does.  How many times did you
Do that? so now you don't have to do that
Anymore because we have expand macro over here with a click
Glance you hover over and you can see the full expanded view
Of the macro and it makes sense it's 45 divided by cube of
Radius -- so it doesn't look that secure anymore.  Maybe it's
A good opportunity to change it. To what? what are you going to change it
To? the context.  This is something
We're added new in studio.  We can do it for small macros.  I
Can see here the change.  It is going to give me a detailed view
Of what happened or you can do it for macro functions.  In case
You turn it into complex for template this is not just a test
Based operation that we're just adding to visual studio let's
Look at this area macro over here.
Go down here and write this.  Anyone know what this does?
It does something bad.  It declares
Pointer called.  That's the macro that it gives you.
You record to macro and are using it incorrectly this is not
An expression we will be able to detect cases and be able to tell
You where the offender is.  We
Still haven't figured out why this test failed.  All of the
Announcement that we have about standards conformance that
Pertain to compilers and libraries pertain to a language
Inside the editor so when we talk about conformance we read
The nefrms inside your editor so if you hover over we compute it
On the fly for you and if i go to this definition over here
There is more examples of things that we do for you.  Obviously
Auto deduction it gives you the
Actual type and c++ saves for typing all the things we can
Tell you what the type actually is of this end play.  Everything
Looks all right with this one i'll go to the main over here
And this is a template, so
Starting to get a bit nervous because my companion, so far
Intel sense i know is not going to be helpful with template this
Is template body there is not much we can do in here.  It's an
Enter, it's correct if i hover over this one yeah that's
Correct if i hover over it. Yeah it's an auto.  Great.  This
Is very useful.  Would it be nice to look at how the compiler
Looks at the template i know you're going to say it doesn't
Look at the compiler template. It does.  Can we look through
The eyes of the compiler to the template here and because i'm
Bad at typing i'm going to copy, if you look at the tool tip of
This particular function, template, i'm going to go over
Here in this new tool tip and i can provide sample template
Arguments for intel sense.  With new phases over here and let's
See what i get.  If i hover over, look vector, and if i
Hover over this value type it's an order.  And if i run it it
Actually makes sense.  If i run it again i get details and if i
Run auto just like before i get the actual type of the template
And if i hover over the operators i get the operator
Overload for this particular case it tells me exactly what
Function is being called. [Applause]
By the way, there is more.  You have ever seen intel sense
Members list showing up in here. All right.  So this is something
That we're adding in 15.8.  I hope you're excited.  We're
Adding a super power to intel sense and we need your help and
Feedback to improve this and making it production quality for
The release for 15.8.  So in summary i showed you a lot of
Productivity features i showed you how you can bring
Modernization angle to your code base by adding new code analysis
Squiggles in the editor turning macros any context if you need
To i showed you how intelligence helps you 17 c++ features and i
Showed you how intel sense can handle template bodies now.  So
I hope i got you all excited and you will download the latest
Releases as soon as possible. Obviously as i mentioned i
Haven't covered all the feature in this demo there is a longer
