Timeline for Copy-and-Move Concept Using Smart Pointer
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 10, 2020 at 13:24 | history | edited | CommunityBot |
Commonmark migration
|
|
Apr 10, 2018 at 20:55 | comment | added | AVH |
Ah, learn something new every day :). Makes sense actually, since obviously the container of MyContainer objects is only going to want to create MyContainer objects.
|
|
Apr 10, 2018 at 15:43 | history | edited | Toby Speight | CC BY-SA 3.0 |
minor tweaks to text; and fix vital missing 'const' (was correct in the full code)
|
Apr 10, 2018 at 15:40 | comment | added | Toby Speight |
And yes, it is default-constructible - explicit doesn't affect that.
|
|
Apr 10, 2018 at 15:38 | history | edited | Toby Speight | CC BY-SA 3.0 |
nullptr safety when calling iota()
|
Apr 10, 2018 at 15:32 | history | edited | Toby Speight | CC BY-SA 3.0 |
Make the constructor explicit, and test it - thanks to Darhuuk
|
Apr 10, 2018 at 15:28 | comment | added | AVH |
I would also suggest making the constructor explicit. Currently this compiles: MyContainer a = 7; , which to me just looks odd. Of course, if you do so, you might want to create a constructor without arguments, which could delegate to MyContainer(0) . That way, you can still create e.g. containers containing MyContainer (if you don't, MyContainer won't be default constructible).
|
|
Apr 10, 2018 at 13:12 | history | edited | Toby Speight | CC BY-SA 3.0 |
using std::swap; justify need for size()
|
Apr 10, 2018 at 13:05 | history | edited | Toby Speight | CC BY-SA 3.0 |
Add some hints for future directions; general overview
|
Apr 10, 2018 at 12:51 | history | answered | Toby Speight | CC BY-SA 3.0 |