09:17:58 From Jaiden Parlone : Why can you do *this when this hasn't been defined? 09:20:08 From Chris Jones : The `this` pointer is available in the constructor 09:20:48 From Chris Jones : In the case of the `operator=` the object was already constructed before 09:21:02 From Jaiden Parlone : Oh so it's like a standard thing? 09:21:08 From Chris Jones : yes 09:21:15 From Jaiden Parlone : Thank you! 09:21:25 From Chris Jones : Every 'non static' method of a class has access to the `this` pointer 09:21:47 From Chris Jones : that includes constructors and destructors 09:22:02 From Jaiden Parlone : Sure thing, thank you :) 09:27:55 From Jaiden Parlone : Sorry, whilst I was typing I missed the answer to Q2, was it A(A)A(A) ? 09:28:32 From Chris Jones : Yes 09:28:37 From Jaiden Parlone : Thanks 09:28:38 From Chris Jones : (I believe) 09:30:14 From Chris Jones : Definitely yes (I had to go back and look at the question again to be sure) 09:30:37 From Jaiden Parlone : Haha thanks again! 09:57:15 From Becky Kowalski : Hi; is there a concise way to describe the difference between using {} and using ()? I don't quite understand the argument of "works if I have nothing". What is nothing in this context? 09:59:45 From Marc Paterno : Unfortunately, the varieties of initialization in C++ are many and thus precise explanations are complicated. 10:00:04 From Marc Paterno : But in this context, “nothing” means that no arguments are being supplied to the constructor. 10:01:10 From Becky Kowalski : I see, fair enough. I guess it comes with practice to see when the best scenario is to use one vs another? 10:01:17 From Becky Kowalski : Ah that was just said, okay thanks! 10:01:30 From Marc Paterno : The search results at https://en.cppreference.com/mwiki/index.php?search=initialization shows descriptions of all the different types of initialization in C++. 10:01:56 From Becky Kowalski : Thank you Marc! 10:07:10 From Marc Paterno : The “C++ Core Guidelines” is a well-respected collection of … well, guidelines for use of C++. It discusses constructors, assignment and destructors, at https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#cctor-constructors-assignments-and-destructors. 10:08:05 From Guillermo : is he typing? 10:09:32 From Marc Paterno : The issue should be cleared up now. IF you are still not seeing Glenn’s typing, please speak up! 10:12:17 From Diana Kafkes : what does the keyword friend mean in line 263? 10:12:54 From Chris Jones : a `friend` is a function or class that is allowed to use the private and protected data and member functions 10:13:14 From Diana Kafkes : cool thank you! 10:19:34 From Jaiden Parlone : Hi, can someone explain why 's.operator' would return 't'? 10:20:30 From Chris Jones : Do you mean why `s.operator==` would return true? 10:21:49 From Jaiden Parlone : Is it not comparing the output of s.operator to true? 10:22:11 From Chris Jones : actually no 10:22:19 From Chris Jones : the function name is actually `operator==` 10:22:33 From Chris Jones : the keyword `operator` is special in C++ 10:22:44 From Chris Jones : it can be followed by various 'operations' 10:23:16 From Chris Jones : e.g. `operator==`, `operator<`, `operator+=` etc 10:23:26 From Jaiden Parlone : Ah I see, it allows you to make an operator a function name. 10:23:28 From Chris Jones : those are actually special function names 10:23:32 From Chris Jones : yes 10:24:23 From Chris Jones : I just checked and it is impossible to declare a member function just named `operator` 10:24:41 From Jaiden Parlone : So s.operator==(t) is basically doing (s == t) 10:24:56 From Chris Jones : yes 10:25:04 From Jaiden Parlone : Cool, thank you very much Chris! 10:25:22 From Chris Jones : in fact, (s==t) is translated by the compile to actually be `s.operator==(t)` 10:45:28 From Marc Paterno : The previously-mentioned Core Guidelines discusses reasons for what Glenn is discussing at https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#cover-overloading-and-overloaded-operators. 10:50:52 From Brian Cruz : Is the first symmetric operator supposed to be "!=", instead? 10:51:08 From Andres Vargas : yes 10:56:09 From Jaiden Parlone : What's the difference in usage of a 'method' and a 'function' 10:57:29 From Marc Paterno : “Method” means here non-static member function. 10:57:59 From Marc Paterno : Function, without qualification, often means free (not class member) function. 10:59:01 From Jaiden Parlone : Sure, thanks Marc and Glenn 11:05:38 From Anthony Tiradani : I forget… what is the difference between int& and int &&? 11:05:57 From Andres Vargas : int&& is for an r value 11:06:11 From Andres Vargas : int& can take an r and l-value 11:06:29 From Anthony Tiradani : So it forbids literals? 11:06:56 From Anthony Tiradani : It == int&& 11:09:56 From Chris Jones : I think of `&&` as wanting values that have not been assigned to variables 11:12:07 From Anthony Tiradani : Thanks! That makes sense to me. 11:16:32 From Andres Vargas : I'm still confused with "unique_ptr can't be assigned" and the use of std::make_unique 11:17:29 From Marc Paterno : To be more precise, unique_ptr supports move assignment and move copy, but not (normal) assignment or (normal) copy. As Glenn is just starting to explain…. 11:17:32 From Chris Jones : remember that calling `std::unique_ptr x = std::unique_ptr(1)` 11:17:36 From Chris Jones : works 11:18:06 From Chris Jones : Which Glenn will probably explain right now :) 11:18:29 From Andres Vargas : Oh ok got it :) Thank u 11:22:20 From Andres Vargas : should 579 read my_unique_ptr& instead of &&? 11:23:03 From Chris Jones : 579 is correct 11:23:13 From Chris Jones : it is a move constructor, not the copy constructor 11:24:10 From Marc Paterno : The difference is that what Glenn wrote will only accept an rvalue, and not an lvalue. 11:27:18 From Ken Herner : Is my_unique_ptr actually supposed to be unique_ptr? 11:28:18 From Ken Herner : Or is the whole thing supposed to be my_unique_ptr 11:28:19 From Marc Paterno : He is showing how to implement something like unique_ptr, but this is not the details of how a fully-functional unique_ptr would be implemented. 11:29:15 From Marc Paterno : But I think all the behaviors he describes for my_unique_ptr will be the same as what unique_ptr does. 11:34:54 From Andres Vargas : Thank you 11:57:49 From Becky Kowalski : Where is it stated that we can call this move constructor with the keyword "move"? If that makes sense as a question hopefully. How from line 951 does "move" execute line 584 may be a better way to phrase that? 11:58:36 From Glenn Downing : move() forces its argument to be an r-value 12:02:47 From Becky Kowalski : I think I'm moreso asking where is it defined that the phrase "move" does that. Or is that written in the language already? 12:03:18 From Marc Paterno : std::move is a function template declared in the header . 12:03:21 From Glenn Downing : Yes, move() is in the standard library. 12:03:42 From Marc Paterno : You can read about the details at https://en.cppreference.com/w/cpp/utility/move. 12:03:44 From Becky Kowalski : Ah alright, thank you 12:04:48 From vmeddage : Where can I find the recordings for today’s class ? 12:05:13 From Jaiden Parlone : https://indico.fnal.gov/event/44790/timetable/?view=standard 12:05:24 From Jaiden Parlone : Is where they're uploaded to :) 12:05:54 From Marc Paterno : Videos are uploaded to https://indico.fnal.gov/event/44790/timetable/?view=standard. 12:06:15 From Marc Paterno : The recording of today’s class will be available some time late in the afternoon today. 12:47:17 From Guillermo : when saying the middle, in this case, do we mean anywhere between first and last or do we mean exactly the middle? 12:48:01 From Marc Paterno : It means anything other than front and back. 12:48:17 From Guillermo : Thanks Marc! 12:58:55 From Guillermo : Thanks 12:59:02 From Jaiden Parlone : Thanks everyone, have a great weekend