CppCon 2019: Jason Turner “Great C++ is_trivial”

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so my name is Jason Turner just in case you haven't been Danny other talks this week Costa CVP cast host of C++ weekly I've got a few projects that I worked on and I'm Microsoft MVP I am independent available for contacting and training this is what I do and this kind of represents what my training days look like although in a different scale of course by the way who here is local to Denver okay who still needs to come to the Meetup because you've never been before okay so that's the name of it I've had a bunch of people ask me after other sessions it's the North Denver Metro C++ Meetup for whatever reason the search engine on meetup.com is terrible if you type that in you probably won't find the meetup even though that's the exact name of it but Google will get you there pretty quickly we do meet every month and have since November 2016 so even though I know many of you have been in my talks in the past you still sat in the back row feel free to take a moment and shift yourselves more forward if you want to interrupt me ask questions yell out there's a good chance I'll end up in the middle of the aisles again today we'll see what happens I do still have one training class good I mean there's still time to sign up for my contacts per class it is tomorrow if for some reason the website won't let you let me know and I'll talk to John okay so great C++ is trivial I am asking the question at the moment what do we mean by great he's you're right easier to maintain more optimizable we're going to touch a little bit on each of these things but really for the most part this session is talking about code that is great and that we're helping the compiler write you know optimize our code this is not a best practices talk per se most of the time when I speak I'm saying you should always do this or never do this kind of thing this is mostly to make you think about the way you write your classes and I'm going to build a little bit on the things that I discussed on Tuesday there's not meant as a direct continuation who is here for the what was the name of that talk see it was less code smells who came to that one oh wow well thanks for coming back I must not have done a terrible job okay we're going to go through some exercises as I like to do we're gonna see how quickly or slowly we go through them honestly I don't really know how this is going to go because it's hard to practice this kind of thing with yourself so we have four options here and I am going to ask you which of these is the optimal design of the four choices which one is going to give us the the best most efficient code okay so let's do it by poll I heard yet so bees who says eh who says bee who says C and who says D okay so what do we got with a we are forcing a move we're not allowing return value optimization to take place with B we get returned value optimisation moved Felician with see what do we have like wait what was that oh sorry I see I can't help myself there's I have no idea why the stage is there it's not for me what did you say someone's yelling something right no compile error no actually it's gonna silently revert to a copy unless you've got like cling tightly or something amped up on here unfortunately silently revert to copy okay so that's a copy and then D is returned value optimization again something like that so I highlighted the ones that are good so I've highlighted the bad ones with a good one good ones okay so I highlighted the good ones good cuz that's what I did I have changed things up a bit I am using a structured binding from C++ 17 get it says get string pair let's assume that the undefined function does in fact do what it claims to do it is returning a pair of strings hmm reference someone hopes it's B hope and wishes wait how does that I don't have a good okay wait oh I'm getting hand signals down here okay this is this could be fun because again I'm breaking the rules with the stage what what what is a gonna do it's going to force a move okay what is going to happen with B who says rvo is gonna apply here oh and see now you're not gonna raise your hands because I made Marshall says rarbie O's gonna happen okay with a structured binding I don't have any actual slides explaining this well the structured binding rvo can't happen here because str1 and str2 are actually references that point back into a hidden object called e defined by the standard which is the actual location where the result from the function call lives yay so B is a copy what does C do I well actually let's come back to see does anyone know that they know for sure what sea is gonna do oh okay yes what what is it gonna do okay okay so lifetime extension because it's because of our value reference to the temporary that was returned by gets stringpair yes and then what happens after that that's still the question basically okay let's come back to that one D it has to be a copy because it's a constant value again just for the record I don't believe you would get warnings from anything except maybe static analysis tools here and then ek2 what what what is e do same as b e is the same as b it's a copy that's what I heard up here by the way for those of you who did not pay attention and sat further in the back if you want to participate more you have to yell loudly or somehow convinced me to walk down the aisle or run up to one of these microphones or something like that okay all right so we got a forced move on a an accidental copy on B C let's get back to see d is a forced cot as a copy even though it looks like a move and E is a copy so at the moment the only thing that we know is a move is a and return value optimisation doesn't apply to any of these the reason I'm saying on C is there's this paper that was approved for C++ 20 that is more implicit moves as David Stone in the room by any chance okay because I believe he is the author or co-author of that paper and as hoping I might get an answer to this question with that paper if you've got an R value reference and you return it then it's supposed to be implicitly a move now but will it count an R value reference of a structured binding as an implicit move I have absolutely no idea I know there are several members of the committee like sitting in this general area are people who attend meetings do you have any idea no idea no idea okay great we don't have any idea it's none of the compilers implement the more explicit moves yet so I can't even test it that's otherwise I would have yeah okay so we didn't learn anything except we learned that structured bindings mess with our notions here this is you know a little bit coming back to Tuesday we don't know what use string does we don't know anything about its function signature we can still make some assumptions about this code tell me who prefers a who prefers B who prefers C okay that's the bulk of the room who prefers D I prefer D just for the record from an efficiency standpoint whatever needs to happen whatever that parameter is that you string is using it's going to be constructed in place we've returned by optimization whatever is gonna come into play on C or D we're gonna construct that in place B we're forcing a move which well we're getting a move I guess we should say or maybe a move I don't know if you string takes a Const reference then then B's just wasted code and it makes us wonder online for right here what in the world is the state of string has it been moved from why why did I put this and my mental cue of things that I have to deal with when I read this code oops knock over the clock okay and a a is whatever it might be a copy it might be a reference we don't know I'm gonna prefer C or D from without knowing anything I thought the code marshal yes if you string takes oh that's true so Marshall said if the string takes a non-constant no sorry if use string and Block C takes a non Constance to a string then the code won't compile so I guess for the sake of this example we have to assume that the samples compile and it's not doing that but it's a very good point really now I just out of curiosity would it work on D if you string takes a non-conference go ahead and beer if get if getstring returns a non-constant reference that's the only case in which D would work if the prayer the function primary took a non-conference a string that sounds right yeah okay so we were reasoning about what we're asking the compiler to do that runt or it's gonna happen at runtime here out parameters versus return values we spent some time on this on Tuesday as well definitely who prefers a I have no problem with DES hoover's be yeah that's we like be Const as many things as we can who prefers C all right Nandy d can't compile really and that was just there to throw you out what yeah I used Const gasps let's invoke undefined behavior that's a good idea maybe I should do a talk undefined behavior all the things okay so uncie I just want to point out we are requiring the compiler to default construct this before we pass it in on line three right it has to do extra work compared to the options on a and B where we can take advantage of just capturing that thing that was returned to us yeah can the compiler just write online option C no no the compiler can't fix this you might see examples you can go on god bolt or compile Explorer Matt compiler Explorer whatever yeah he's over there just for the record you look everyone look at Matt no I'm just kidding okay so it happens that I have too much flexibility you can construct examples where the compiler would optimize that version away and the general case we can't assume that we have to assume that it has to default construct that string and then pass it in and then assign the value to it it's only going to be able to optimize it away if the implementation of get value is visible to the compiler or you do link time optimization perhaps all right assignment versus initialization I am probably moving slow it's fine okay go ahead just yell out something what do you we like is that the same code yeah okay so what are the problems let's see on B potential problem yeah well on B let's see yes we construct it and then we have to do an assignment same thing as a but we also get an extra problem on B special problem bonus problem as a constant return value so now we're doing a copy assignment set of a move assignment but C and D avoid those problems altogether it's another question of initial default initializing the thing first reassignment of values who prefers a who's gonna say a is better more efficient code more efficient code really Richard sorry since you're in the front row and I know your name it's not okay sue so in my talk on Monday I had Yan get up on the stage with me if any of you are here for that although it was in a different room we are talking about returned value optimization being you know basically another neither a copy nor move comes into play and guaranteed copy illusion kind of rules if the object val is here and in the second block then i don't have to do an assignment i'm just giving a name to the temporary that had to be returned from the function in the first place and and block AI have to do an assignment operation each time it's gonna be more work if the scope is only for that if i only care about a nut scope okay point of this talk was great c++ as trivial let's talk about triviality okay i'm sorry i have to do the disclaimer here i have lots of quotes from the standard i'm sorry we'll see how it goes is trivially destructible this is if it is destructible and it is a non class type or a class type with a trivial destructor that is what this is saying is this trivially destructible yes clearly nothing has to happen in its destructor is this trivially destructible oh i heard like a very loud yes who did that you know what i've been carrying this around for a few days so you get to have it now all right all right so if the explicitly defaulted indeed no if the implicitly defaulted destructor would have been trivial than the explicitly defaulted destructor is trivial okay good that's trivially destructible as this trivially destructible no we gave it a destructor does it do anything no but it's still not trivial not really destructible so the static asserts here are just theoretically proving these things is this trivially destructible no why not because string is not trivially destructible that was the general murmur yeah okay string is not trivially destructible a trivially copyable type this is where things get fun if the underlying bites making up the object can be copied into an array of car unsigned car or byte if the content of that array is copied back into the object the object shall subsequently hold its original value so it's something that we can copy the bytes around has at least one eligible copy constructor move constructor copies on an operator or move assignment operator where each eligible thing is trivial and it has a trivial non deleted destructor who has ever deleted their destructor why why I know I'm gonna since I just gave you a yeah why did you delete your destructor testing concepts okay so not in production code for some reason I have the no not in production code either just to show off okay who programs in C++ and mostly because they like showing off okay just for the record if you delete your destructor it is valid code you can new an object put it on the heap and then never clean it up in the lifetime of the program you can write valid code with objects that have had the destructor delete it it's a very strange thing to do okay is this trivially copyable I put the precondition up there that int is trivially copyable yes and then I have another static assert down here string is not trivially copyable is this trivially copyable no because it has a non-trivial destructor okay trivial constructibility let's see is is known to call no operation that is trivial so during its construction has to call no operation that is trivial wait what I say that wrong it has to call no operation that is known to call no operation that is not trivial they feel like they could have removed at least one of those negatives somehow and cleaned up the sentence we cannot call non-trivial operations during construction that's over going for so this thing this struct s with an integer in it and an explicitly defaulted default constructor it is trivially constructible now I'm gonna let's see if I can no I can't do that nevermind I'm gonna use the wireless mouse so right here is trivially constructible this is is the type trivially constructible with no parameters this is equivalent to the default constructor that is true it is also trivially constructible with a copy of itself it's trivially copy you will construct copy constructible or not of the same type if I try to call a non-existent constructor one that takes two integers then this is false because it can't be constructed at all with two integers and if I try to pass it one integer it is also not trivially constructible because this constructor exists it doesn't matter that the constructor does nothing and just for the record these are all tested compiles so the fact that I declared a constructor that takes an integer means it is not trivially constructible from an integer is trivially default constructible it's this you know it's that base case the one on line ten if that's true then it's default contributed default constructible this is trivially default constructible and yeah so that is the equivalence here nope I'm already getting nope nope nope not trivially default constructible because we defined a default constructor as this trivially default constructible this is where it gets fun in my opinion who says yes this is trivially default constructible who says no this is not tribute we default constructible wait wait wait Richard you raised your hand on the second one why not I'm already picking on you why is that not trivially default constructible I don't think your logic followed so I'm not going to bother repeating it for the camera I'm sorry just for the record for YouTube and for the room I've known Richard for what five years now or something so I mean I give him a hard time a little bit it's okay yeah yeah okay no um actually more correctly I didn't fully understand your logic what does what happens if I default construct an object of this type the member gets value initialized to zero what happens if those braces aren't there nothing it's whatever memory was there it's undefined behavior to read that value because it's an uninitialized value this is initializing it it's like the compiler synthesized a default constructor for us that meant sets this value to zero so this is not trivially default constructible okay so if I remove those braces it is now trivially default constructible again difference we're doing a constructor that does something in a constructor that does not do something ha is trivially copy constructible that's just it is if is really constructible with itself so yes this thing is trivially copy constructible oops this one is not trivially copy constructible simply because standard string is not trivially copy constructible now who's going to go and like make like a poster with all of the type traits about triviality after this maybe I should put one up on you know okay string is not is it is this trivially copy constructible you're raising your hands yes ok who says yes this is trivially copy constructible ok does anyone want to make an argument for why it is not trivially copy constructible ok so it is trivially copy constructible we can copy the bytes back and forth its default constructability does not affect copy constructability his trivially move constructible trivially move constructible yes trivially move constructible no string has to do something on a move is trivially assignable it's again it says it's known to call no operation that is not trivial if this trivially assignable and in what ways we have options is it trivially copy assignable is it trivially move assignable is it trivially assignable from an integer no even though it's just an integer and all I'm doing is copying that value of an integer over this is not trivially copy assignable from an integer so we have been broken out here we can call things that don't exist and make no sense and we'll get the proper response from our well compile time static assertion copy assignment and user-defined assignment operator is simply not trivial no matter what's in it is trivially copy assignable it's just a shorthand for calling this is trivially assignable with a dereference and a constituency it's what we've already been looking at so this is trivially copy assignable no we've got a string in here it's not trivially copy assignable trivially move assignable again it's shorthand is tribulus honorable yeah we see a pattern no ok string is not alright get back to something a little bit more interesting is trivial scalar types trivial class types arrays of types of such types and see what a CV mean Const or volatile qualified versions of these types are collectively called trivial types a trivial class is a class that is eight review is trivially copyable and has one or more eligible default constructors all of which are trivial I find this note interesting I have a theory I've yet to prove it but I think that if you were to remove all of the standard and leave only the notes and examples there would be a lot to learn from just reading those like forget what the standard says just read the notes and examples so this little note in particular a trivially copyable or trivial class does not have virtual functions I'm not a hundred percent sure why that rule is true the Peter is oh wait no it's the up okay because we have to stamp out the V table pointer in the copy operation it is not trivial so you said dude okay so initializing an object of the type requires work to be done because the V table pointer that makes that okay so is this a trivial type I mean I have the static asserts there yes it's a trivial type it's not a trivial type it doesn't have a trivial default constructor but it is trivially destructible okay is this a trivial type no it is still trivially destructible and trivially a not really default constructible and is not trivial okay so I went from moving slower than I expected to faster than I expected so here we are which of these versions is most efficient and why I'm just talking efficiency at the moment okay I'm just letting some people read the code just for the record because actually see eyes looking up at the screen B and D so because int is a trivial type they're all going to boil down to the exact same assembly this is what the answer is I just got and I am going to agree with that statement they're trivially copyable trivia movable is it a copy is it a move does it have to whatever it doesn't matter they're all gonna fit in a register easy on any platform no oh no they wouldn't fit in a single register and an AVR when they because into 16 bits it's an 8 bit I think that's it has to be efficient yeah Oh int you're saying yes yeah int has to be efficient although it has to be at least 16 bits I believe I think that's right so on maybe platform it's so inefficient a single register necessarily so yeah like int is the efficient word size of the system except when it's not or something I so returned by by you I say irrelevant and distribu Lee copyable and movable what happens if I disable optimizations on this code what happens I build this with a zero ooh okay well I've heard the speakers in the past I might yes what are you gonna say yeah okay so for the sake of you who couldn't hear that let's just go ahead and compile this this compiles to move by ax comma 5 we're moving five into the register ax this is the return value from the function returning an integer on Intel platform okay I'm going to disable optimizations here of zero the code still had to the compiler still had to actually generate a call to standard move it had to we told it to we called function all right so let's go ahead and take out move and it becomes more what we would expect a little bit of stack handling and then move five and Dax basically so it's not a hundred percent the same depending on what build level we're using now that's what I just did okay I am using my structured bindings with my integer pairs now instead of string pairs what house my pair implemented I'm assuming it stood pair okay all right so I mean based off of what we just learned who says what I don't know how do I even do this because at this point we're assuming multiple answers are correct right probably B and D I know I fixed those slides I fixed them during tone even yards talk I must not have reloaded at my presentation now I'm gonna risk doing this let's see I must have missed a couple of cases I'm sorry okay let's assume they compile all right we're returning into one I can't easily edit it right here live okay so a and C and a debug build are going to generate these calls to move probably no way around that B and D copying some bits around they're going to be the same in an optimized build they're all the same now I start putting an Asterix here irrelevant Asterix we'll come back to that asterisks in a moment passed by value vs. passed by move oh man C doesn't compile - dagnabbit somebody reboot Jason no I did not just crash I was just staring at the code it's probably non-obvious to the YouTube viewers on camera there's a monitor right here that I can see the slides on I had not just like shut down I was staring at the monitor okay alright so we're passing these things by move or by value now to make a point that Marshall I believe brought up earlier with the string a and B will you know a will compile if you sent as expecting an endurance but if it's expecting an nth by copy or Const reference these are just going to be the same thing again right it doesn't matter now yeah and a debug build a would create a local variable where C would not it still has to create local stack space for it in either case in a debug build so if we want to go down this road let's forward declare the function and that's the there okay so I set up space for it I saved the value 5 here on the stack passed that in all right and we're comparing that to this version okay yeah I have other examples that will come back to similar but I didn't see that particular issue okay so again irrelevant asterisks and is trivially copyable and moveable out parameter versus return value that's when I was just having fun with and I really hope I have the correct version of my slides up right now and if I don't now I'm going to fix it I know I changed wait a minute all right well whatever I have is what I have now I know I build the latest version okay pots I know the next slide said wrote largely irrelevant again but so we're well okay let's come back to it let's go no all right stop we'll stay here I have I have a clearly well-defined plan at the moment right how many parameters do these functions take they all take one parameter is that fair no yes so because because this int actually fits in the EAX register here I we actually are not going to get that set up of the stack space for our di and in these cases here so I guess they don't all take one parameter with an int hmm so that slide makes that incorrect memory address the result but the result has to be dealt with regardless all right now I want to ask this does this change anything so I'm looking at that the fact that I added these braces what am I now to this value embel you initialize it I am giving it a value without those braces it's a trivial operation it's going to do nothing with those braces that has to initialize it before it passes it to the function and this is the slide that I know that I added earlier that I hope hey it did work okay good all right this looked more and more suspicious to me as I was preparing for this talk does this code bother anyone okay give me reasons are we going back here Matt - there are my passing and undefined value is that supposed to be a reference to capture so yeah let's take my hypothetical implementation of get value what is the value of s on line 1042 junk was the other answers undefined nasal demons that sounds really bad you know I've heard that term over and over again I don't know who coined it what's it nuclear launch codes yes we don't know right worse than we don't know we are invoking undefined behavior specifically by accessing them an uninitialized value that's bad so our parameters open the door for undefined behavior that's stronger wording than I've ever used before about out parameters I like it though all right so assignment versus initialization optimized build let's say even unoptimized builds in these cases little bit extra work in the unoptimized build version nope no I don't see actually in an optimized build version there's any extra work anywhere is there are these all exactly the same lissa build type yeah I think they are I'm getting nods over here I'm gonna agree with them all right power of true be a lady and I still have my asterisks then tis trivially default constructible and trivially assignable does this change things yes but when in a debug build and an optimized build the compilers gonna optimize the way this dead store I think I used those two words correctly that's the right to the memory location online for that was never read from again so it will then just write in the same memory location to get on line five well actually it'll just completely optimize away s altogether and optimize build in this case value reassignment does it matter Richard no it doesn't matter because answer trivially copyable trivially assignable trivially destructible alright the asterisks with the optimizer disabled we still have to deal with these things setting up stack space initializing value is calling standard move even when the types are trivial so our best practice options are still the best options okay is a rage review I I got lots of it depends answers oh let's do yes it is trivial okay no it is not trivial it depends okay what does it depend on the type whether or not the type contained is trivial it's guaranteed to be trivial if the type contained is trivial so I was playing with this now if you were here on Tuesday and my C++ code smells I was not very happy with the second option they get s bad I'm not even going to ask you which one is supposed to be good or bad because I am good at aiming and you can tell which one's supposed to be good or bad now on the second example on get us bad if these were not trivial types I have to construct them both I have to move out or copy out the correct parameter or the correct return value and then I have to destroy whatever was left over and on the good one quote good one I get the efficiency of just doing return value optimization right so I don't have this setup as good as it could be setup but in an optimized build these two versions compile to the exact same thing it does a branch to test which whether or not we passed in true or false here and then it returns either set of values and in the quote bad version it does the test and then it returns one of the two efficient values there's no lifetime for it to have to worry about can everything be trivial what can't be trivial polymorphic objects okay heap at the moment anyhow right yeah are any Rai guide so basically anything with the destructor can't be trivial any manager oo based derivation anything that's managing resources or dealing and runtime polymorphism effectively they can't be fully trivial anything that's dealing with resources definitely can't be trivially destructible right because that's silly because that's what destructor czar for okay not everything obviously can be trivial I do want to point out though that most things can be made trivial and I mean just or at least trivially destructible and that is where most of this power comes in just for the record I mean I've implemented an arm emulator that is constant spar and some of you may have seen that project so I have effectively proven that you can do anything at compile time because I can execute arbitrary arm code at compile time right so QED or something because I'm like a mathy person so I've got a container the value type and a fixed capacity I can make the underlying data storage an array that has a value type in a capacity now this value type is an integer my container is trivial tribute destructible trivially constructible I said the current size here and I have to default the size to zero because now we're going to start modifying this thing it's now low long or trivially constructible but it should be trivially a sign away to rage reveal the assignable it should be yeah yeah okay yeah so it should be trivially assignable trivially copyable trivially not tribute liek constructible but still trivially destructible and then I can add a pushback function which we can see can be constant for here and I can just increment the size and add the new value in so okay they're the I'm not doing any balance checking at the moment but then again the standard library doesn't really do bounds checking yeah so it's good right yes Marshall stood earache does not add stood iterate doesn't have a default constructor iterator has zero constructors yes that is it is a work of art once you realize that standard array has no constructors at all it makes me happy it's and basically we're not allowed to do the same thing they do because they're in a storage starts with underscores and we're not allowed to see or touch the underscores yeah so this can be this it's trivially not trivially constructible because of our size but the array is not going to stop that because arrays constructor is going to do nothing if there's an ax Jers it's gonna be filled with garbage the issue is bounds checking okay so if we can throw a logic error in here or something we can throw an exception we can do bounds checking even in a context for function just as long as that branch is not invoked at compile time if it is then we at a compile time error which makes sense because we just went past the end of our container at compile time so it sounds like compile time error to me and then we could do things like assert that the contained type is trivial if we really wanted to like push things here although that seems that's maybe a bit heavy-handed maybe if we really want to do that we could just assert that it's trivially destructible and trivially assignable or something if we wanted to to limit the users of this type but we don't have to either it know so the comment was it has to be trivially default constructible for a ray for a ray to be trivially default constructible yes so if we made this an array of strings which I actually did mean to get to then then this is no longer tribute Lida struck table and we're going to initialize all of the strings in there if we had ten strings they're all going to be empty strings it's going to create those objects like it's supposed to yeah and then I can I can use this and if you really want to like I think I created an array of a thousand of them just to point out that like because they're int it's not like it really has to deal with all thousand it just has to put a little bit of code for that exception handler in here and then the actual code being executed for adding those values back is pretty straightforward like this does nothing of any consequence comparing to vector what happens when I do pushback of one on vector allocate so what happens when I do the second pushback it's probably going to allocate and copy those values in and I'll probably have a vector of size two or capacity to what happens if I do another pushback another allocate and other copy and now I'm gonna have a vector of capacity for depending write like I'm looking at standard library implementer right in front of me here something like that though basic string basic string I wanted to mention because actually as Brian in the room no okay basic string is interesting because it is the only container in the standard library that requires that the contained types be trivial so you can use basic string and it's going to use small string optimization for a piece of this but not I'm not gonna walk through all that not for all of it okay so bringing us around to the rule of zero rule of zero says never define any of the special number functions with class initializers this can include the default constructor as well this likely results in less code and smaller more efficient compiled code we're giving the compiler a lot of room to optimize when we're not defining these special members so it is trivial being trivially destructible and tribute leak copyable are probably the best things that you can do to write optimizable code trivial default constricted constructability is not really our concern we like initialized values we like not invoking undefined behavior by reading uninitialized values probably and it doesn't affect our other operations follow the road zero and triviality or understanding triviality is one of the main keys for writing code that is constant or friendly I just threw in one little context for keyword in there in case you didn't realize that is a context per container I mean you can just create one of those and use it at compile time and grow it and access the members of it it doesn't take much work to add the rest of the members that you need so that is me we're just about I mean I'm done when we have like five minutes left if anyone has any questions either yell them out or go to a microphone or I'll run around any questions end of the day on Friday huh oh yes a stood array of non-trivial type that's a length zero now I believe if your standard library will prevent you from creating a stood array of length zero because an array of length zero is a non-standard extension to the language that many compilers implement but it's not technically allowed because of address rules each object must have its own location in memory if you have two arrays of lingzi or side by side they'd have the same address not allowed to do that yes though the mics not even on this yell okay so small vector you're saying may be standardized and I a fixed capacity vector called small vector and I think boost static vectors of similar notion okay yes no no yes so this is not trivially default constructible because of the initialization of zero that's what I tried to say but I may have gotten lost in the double negative somewhere the data member is maybe trivially default constructible but the size member is not yes no so this is not going to be fully is trivial it's going to be potentially trivially default constructible assignable movable copyable all the things that really matter all right thank you everyone [Applause]
Info
Channel: CppCon
Views: 22,352
Rating: 4.6691728 out of 5
Keywords: Jason Turner, CppCon 2019, Computer Science (Field), + C (Programming Language), Bash Films, conference video recording services, conference recording services, nationwide conference recording services, conference videography services, conference video recording, conference filming services, conference services, conference recording, event videographers, capture presentation slides, record presentation slides, event video recording, video services
Id: ZxWjii99yao
Channel Id: undefined
Length: 54min 52sec (3292 seconds)
Published: Sun Sep 29 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.