Timeline for C++ Student Class
Current License: CC BY-SA 3.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 10, 2020 at 13:24 | history | edited | CommunityBot |
Commonmark migration
|
|
Jun 5, 2018 at 1:39 | comment | added | JDługosz | @I'lladdcommentstomorrow If you do that, the default assignment operator will not be generated. | |
Jun 5, 2018 at 1:37 | comment | added | JDługosz |
Re Herb: Don’t forget “slide code” does not follow the same standards. @Voo, using declarations in your CPP file is fine; directives are problematic. There are some namespaces meant to be used in a using directive; std in particular should never be.
|
|
May 23, 2017 at 12:40 | history | edited | CommunityBot |
replaced http://stackoverflow.com/ with https://stackoverflow.com/
|
|
Oct 10, 2016 at 18:46 | history | edited | Jamal | CC BY-SA 3.0 |
added 151 characters in body
|
May 16, 2016 at 10:11 | comment | added | I'll add comments tomorrow |
Without setters for the private member, they could be const , I guess.
|
|
May 11, 2014 at 9:42 | comment | added | MartinHaTh |
Getters and setters are usefull, because of encapsulation, and thus you have a more stable API. In case you would want to store gender as a Enum instead of a char you would run into trouble. Also, wouldn't it be better to make operator<< non-friend, and use the getters?
|
|
May 11, 2014 at 3:10 | comment | added | user33306 | I find an IDE with real time syntax checking makes the name clash argument largely passe. I've studied several examples and have yet to see a significant compiled size difference between code using namespace std, and code not using it. | |
May 10, 2014 at 21:42 | history | edited | Jamal | CC BY-SA 3.0 |
added 351 characters in body
|
May 10, 2014 at 21:38 | comment | added | Voo | @Loki "You can and should use namespace using declarations and directives liberally in your implementation files after #include directives and feel good about it. Despite repeated assertions to the contrary, namespace using declarations and directives are not evil and they do not defeat the purpose of namespaces. Rather, they are what make namespaces usable." Item 59, in C++ Coding Standards. Also most of his example code you can find. I also distinctly remember STL using it in his coding during Going Native, etc. | |
May 10, 2014 at 21:37 | history | edited | Jamal | CC BY-SA 3.0 |
added 351 characters in body
|
May 10, 2014 at 20:59 | comment | added | Jamal |
@Voo: I do agree about the gender thing, and I haven't quite looked at that. I suppose an enum would be a better option?
|
|
May 10, 2014 at 20:57 | comment | added | Loki Astari | @Voo: Then you need to read Why is “using namespace std;” considered bad practice?. Please provide an example of your speculation about Herb so we can comment on the situation (as all usage is dependent on the situation (in the general case it is a bad idea and the advice here holds)). | |
May 10, 2014 at 20:49 | comment | added | Voo |
using namespace std in a header (or before including a header) is obviously problematic, but even Herb Sutter uses it in non-header files all the time so I strongly disagree with the first note. Apart from that using a char for gender is a bad design I'd say.
|
|
May 10, 2014 at 17:40 | history | answered | Jamal | CC BY-SA 3.0 |