Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
[Music]
welcome to visual studio 2022 for
siebel's plus developers my name is sai
brand i'm the team siebel's plus
developer advocate and today i'm going
to show you why you should upgrade if
you're a cbox plus developer
now before i get started the mission of
the c-plus plus team here is to make the
lives of all cbos plus developers on the
planet better and that comes with a
bunch of different facets to it we
participate in the standards we drive
our own proposals we help others with
theirs we prototype proposals
we invest in our toolchain our compiler
and libraries we bring them up to the
latest standard we
improve their performance and their
security
we simplify dependency management with
vc package which is an open source
package manager
we improved the visual studio ide to
make it the most
productive experience that we can
and then we continue to enhance the cbs
plus experience for visual studio code
as well
but today we're going to focus on two
and four our tool chain and the ide
and on the ide front one thing you might
have heard a lot today is visual studio
2022 is 64 bit and the cpus plus team
have made sure that this transition can
be as smooth as possible
so a few things you'll notice is the new
projects are going to target 64-bit by
default
and if you have these kind of huge
projects which previously you might have
struggled with memory usage should be
less of a problem now
and we do want to make that upgrade as
pain free as possible so you can install
the 2015 17 and 19 tool sets directly
from the installer in 2022 just by
clicking those buttons
you can even
install miner toolsets side by side as
well
if you have binary dependencies which
you can't necessarily recompile we are
guaranteeing binary compatibility back
to 2015 so if you have those
dependencies you can still upgrade to
the latest tool set
if you have open source dependencies
then you could potentially use vc
package to to upgrade to the new toolset
for those if you'd like to know more
about porting and upgrading specifically
you can check out aka dot ms slash cpp
upgrade
now a few other reasons you might want
to upgrade
hot reload is a new feature in 2022 and
has support for cbs plus
so this lets you apply code changes
without stopping a breakpoint or
restarting your application
it injects your changes into the app
dynamically and doesn't trigger a full
rebuild of your project this is super
useful if you're developing an
interactive application like an uh a
video game for example where you might
want to make a change and immediately
see this reflected in the running
program without having to to stop or
recompile
you can even
click this little button on the right
here to
to hot reload on file save
if you want to know more about hot
reload you can check out aka dot ms
slash hot reload cpp we also want to
make sure that visual studio is the best
choice for if you're developing on
windows but targeting any platform not
just windows and part of that is wsl 2
support
so this allows you to build and debug
cbs plus code on wsl 2 distributions
without having to set up an ssh
connection
and it has support for both cmake and ms
build we would recommend cmake if you're
doing open source development but ms
build support is there as well
and if you'd like to know more details
you can check out cbp
hyphen wsl2
and then we also have experimental
support for lib fuzzer lib fuzzer is an
in-process coverage guided evolutionary
fuzzing engine from the llvm project
so if you're wanting to fuzz your um
your apis in order to
guarantee their correctness and security
then you can use this it's now available
in vs 2022
and you pass f sanitize equals buzzer if
you'd like to know more you can check
out aka.ness cpp lib fuzzer
now if you can
upgrade your
um
your ide that's great if you can upgrade
your standard of siebel's plus as well
that's even better
so where we are with siebel's plus
conformance right now is all stable
sequence plus 20 features have been
completed there are a few defect reports
which um came in late they're kind of
like bug reports to the standard they
came in late in the process so we're
still dealing with those but all stables
plus 20 features are now available
understood sequels plus 20 switch so we
guarantee that these are api stable and
their performance at their um production
ready
we also have some sequels 23 features um
all of which have actually being
contributed by
all of you folks to our open source
standard library so that's great
coming next we are focusing a lot on
standard library modules and core
routines both the proposals going
through the standard and implementing
them in our tools
um on the stl specifically we have 115
sql 20 features completed
and a bunch of those have been
contributed by you so thank you so much
for all of that you can see the graph
here for c plus 20 features you can see
the little bump at the end as is those
defect reports coming in
um but we're starting to get all of
these back down again
you can check out the the most recent
data at microsoft dot github dot
slash stl
now i'm going to demonstrate the four
main features of c plus 20 all working
together in tandem
okay so i'm going to create a new
project
an ms build application and i'll call it
launch
so this gives me a new project i want to
show ranges modules coroutines and
concepts all working together
so i'm going to show a little random
number generation example so i'm going
to get a bunch of random numbers random
numbers helps if i can type
and i'm going to get these from
something called launch xor shift
x or shift is a specific random number
generation algorithm which is
implementable in about five lines of
code
and actually generates pretty decent
random numbers
of course we need to seed it with some
high quality c like four
and then we can say loop through all of
them
random numbers
and print them all out
with a new line
okay so this is what basic usage is
going to look like and now we can think
about how to actually implement this now
i want to use modules and curatings for
this so the first thing i need to do is
go into my project properties
go to general
and language standard flip this from 14
to sequester latest
okay
now i'm going to create a new module
add to my source files a new module
this will create a cpus module interface
unit which you can see has the extension
ixx and we could call gonna call it x or
shift
all right this gives us a couple of
lines we have module x or shift which
says from here down everything belongs
to the module xor shift additionally
export this and make it available to
external code
then we have a single function called
myfunk
which is also exported
if we got rid of this then myfunk would
not be visible to external code this is
one of the benefits of modules apart
from improvements on build times
you can hide implementation details of
your code without having them leak into
contexts that you don't want them
but we don't want this we wanted
namespace launch
and if we want to export everything in
here we can just say export
okay so now we can think about
implementing xor shift
we want this
to be an infinite stream of random
numbers
uh but for now let's just implement it
as a single iteration of the algorithm
so we'll return a state unit
64 t
our function will be called x or shift
and we will take a unit
64 t as an argument
so unit 64 t is
in the ceased int header
just to show you something first say i
put it here
um
this might look fine but
remember i said that modulex or shift
means everything below here belongs to
this module
hash include means just take everything
from this header and dump it into this
file so we're saying that everything in
here is going to get module linkage and
we're going to get some build issues
with that so this is actually wrong like
if we had an uh import of some module
here then this would all be fine modules
are dealt are designed to handle that
but for regular hash includes we want to
stick them up in what's called the the
global module fragment which we
introduced like this just something to
be aware of okay so
the intellisense found this and we're
all good to go
so we can implement
xor shift like so we take our seed we
xor it with the result of right shifting
by thirteen
then left shifting by seventeen and then
right shifting by seven
uh
the very definition of ra of uh magic
numbers
don't ask me how they got these and then
we return the seed okay so this is a
single iteration of the exoshift
algorithm
but we wanted this to be infinite uh
unfortunately i don't have infinite
memory on this laptop so we're gonna
have to generate these on the fly and
one way we can do that is using core
routines
so coroutines are essentially a
generalization of a subroutine or
regular function a subroutine will enter
up here at the top it will exit at
return statements or
flowing off the end of control flow
one entry
some exit point
a core routine instead can
pause or suspend during execution and
then be resumed later
and one of the ways to do that is using
co yield which generally means
pause execution
send this back to the caller
and then we can be resumed later
so we're going to stick this in an
infinite loop
and now we're getting build errors
because we haven't included creatine
traits
but
there's something more here core yield
doesn't actually have built-in behavior
you have to kind of tell the compiler
what could mean for this specific core
routine and the way you do that is
customizing the return type here so we
want like a kind of python style
generator here unfortunately there's no
generator type in the standard library
for c plus plus 20. uh there should be
in c 23
but we could use a an open source
implementation i have one myself called
tl
generator but if we try this we get
build errors because i don't have tl
generator installed it's open source so
i could use vc package for it
i do have vc package installed on this
system
so i could just install tl generator
from the command line but i want to show
you
manifest files
so manifest file
is kind of similar to like if you've
used npm for javascript or cargo for
rust where we declaratively
say things about our dependencies and
our package so we have a name i'm going
to call it launch we have a version
string
i'm going to do 1.0
and then we have dependencies and this
is a list of dependencies you could
actually put versions here or minimum
versions there's a bunch you can do but
for now i'm just going to say tl
generator and there's a package or a
port in vc package which tells it how to
download and build and install this
library
so if i save this to
the root of my directory in
vcpackage.json
and the last thing i need to do to get
this to work is to go to my project
properties
configuration vc package use vc package
manifest yes this will tell the build
system to pick up the manifest part
so now if i build my solution we should
see this happening and the first thing
which happens before bc package is ms
build scans the sources for module
dependencies so you do not have to tell
ms build the order in which your modules
have to be built it will work it out by
itself uh we don't have this for cmake
yet but we are working on it with
kitware
so after
the module dependencies were scanned
then vc package ran and you can see the
install tl generator
it will also installed a couple of
transitive dependencies which tl
generator has
and even used some cache binary packages
which i already had on my system
which is pretty handy it told us you
know if we're using cmake then we could
just copy paste these in edit them
slightly and then we got a bunch of
build errors because we haven't finished
yet
but that should be enough to come up
here and say include tl
and it found the installation this is a
local installation this is not going to
affect any other projects in our system
tl generator
and intelsense found
the file great
um so now we can go to launch
include that and then import
and there we go and uh intellisense
there found x or shift because it's
scanned for the dependencies it knows
what file it's in
so we can import x or shift and now
uh intellisense worked out this type and
everything's fine
so
we could run this it would give us an
infinite stream of random numbers um
let's say we want to
reduce this infinite stream of random
numbers a little bit say we want
them to be in the range of 0 to 100 how
could we do that
well one way would be with ranges
so we could say hash include ranges and
ranges are a way of essentially building
up a pipeline of operations on ranges of
data
one way we can do that is saying
uh pipe this this is kind of like a unix
pipe like a bash style pipe
pipe this into stood views colon colon
and
now we get a list of all of the view
adapters in the standard library which
are available to us and you could use
your own or other ones which were open
source
uh one thing to note is
um if you used range v3 the precursor to
all of this and an older version of vs
then you probably find that intellisense
really really struggled we've done a lot
of work on this you saw that that was
pretty much instantaneous so if i say i
want to transform it then intellisense
works says okay you need a function here
um so we're gonna pass it
a lambda
which
returns i
mod 100 let's see
okay
so
now we can try running this and we
should get out an infinite stream of
random numbers
here we go from 1 to 100
great
now say we actually want to
change this slightly
and see it update in real time i talked
about hot reload earlier i have hot
reload on file save turned on so if i go
and change this to a larger number and
save
then it will recompile while it's
running and
we see the change immediately it's kind
of cool
but say
we don't want this to be infinite we
want this to be
to be bounded we could instead say pipe
this again into stood views take and
take the first five for instance
uh
and this
should print out there we go five random
numbers
uh a couple last things
um
the usual kind of navigation experience
you might expect for modules is all
there so if i
control click on the module the name
then it goes to the definition
let's say i want to stick a breakpoint
in here
this is a core routine so there's a
bunch of compiler magic which is going
on here like this is kind of changed
into a state machine and split up into
different functions
um but we make it all look like
it's just regular code so if we step
over this code yield
like in this time the
this co routine has been suspended and
then resumed but we make it look like
it's just
going on um
like a regular function we even have a
co-routine frame
visualizer in case you're writing your
own code routines so to recap we saw
modules with build system support and go
to modules we saw coroutines with
debugging support we saw ranges with
intellisense all working and we kind of
solve concepts concepts are what
underlie ranges so that's how we saw
those working
um to reiterate our the mission of our
team is to make the lives of all
siblings developers on the planet better
through standards through our tool chain
through vc package through our vs ide
and through the visual studio code
experience
if you'd like to know more about some of
these we do have a couple other talks
today one on game development and one on
cross-platform development so please do
check those out and other than that i do
hope you will go away and upgrade to vs
2022 and let us know what you think
thank you very much
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.