Lounge<C++>

Today we're daydreaming about C++26 reflection
Apr 8, 2015 19:13
thank you all, sorry for the initial misunderstanding
Apr 8, 2015 19:12
@райтфолд now it all makes sense
Apr 8, 2015 19:11
@райтфолд yes, that's true
Apr 8, 2015 19:10
@Mgetz oh, that's interesting
Apr 8, 2015 19:09
@райтфолд then is that how "name1" gets deleted without the need for a garbage collector?
Apr 8, 2015 19:08
@райтфолд maybe the string operator= calls the destructor on the old value before assigning the new one?
Apr 8, 2015 19:07
std::name = "name1";
name = "name2";
Apr 8, 2015 19:07
@Mgetz exactly, but the variable itself is still in scope here, the value "name1" is not
Apr 8, 2015 19:05
@sehe that is starting to make more sense
Apr 8, 2015 19:05
@sehe and technically?
Apr 8, 2015 19:05
@райтфолд that's not the case I was presenting
Apr 8, 2015 19:04
@райтфолд isn't "scope" a thing for variables, and not values? The variable does not go "out of scope"
Apr 8, 2015 19:03
better, how does it know to call the destructor on the object
Apr 8, 2015 19:02
@Mgetz but the variable is the same, how comes a destructor is called?
Apr 8, 2015 19:01
but how does C++ stl "know" to discard the value
Apr 8, 2015 19:01
I have no idea how C++ does this. Java has a garbage collector.
Apr 8, 2015 19:01
I'm trying not to use new right now
Apr 8, 2015 19:00
@sehe so the name for the value held by a variable is "temporary"?
Apr 8, 2015 18:58
I'm trying to find a term
Apr 8, 2015 18:58
thanks
Apr 8, 2015 18:58
@Mgetz Resource Acquisition etc.
Apr 8, 2015 18:58
what is "name1"?
Apr 8, 2015 18:58
std::name = "name1";
name = "name2";
Apr 8, 2015 18:57
In C, "unreferenced value" sometimes is "leaked memory".
Apr 8, 2015 18:57
The one about I got shouted at before
Apr 8, 2015 18:56
In Java, it would be "garbage collection candidate"
Apr 8, 2015 18:56
I mean, a value that was "held" by a variable, but is not anymore.
Apr 8, 2015 18:55
rvalue is any value
Apr 8, 2015 18:55
@sehe absolutely true, just a random doubt. I'm having a problem elsewhere. I know that std stuff gets cleaned up when it "goes out of scope" (e.g. variable in a function). I don't know if "value lost by reassignation" is the same as "going out of scope". Probably not, since "scope" is for variables. I can't recall the right term for "unreferenced value".
Apr 8, 2015 18:35
will have a look at it
Apr 8, 2015 18:35
bye
Apr 8, 2015 18:34
safe?
Apr 8, 2015 18:34
const char *other_name1 = "name1";
const char *other_name2 = "name2";
name = other_name1;
name = other_name2;
Apr 8, 2015 18:34
just making sure
Apr 8, 2015 18:34
@sehe ahem, sorry
Apr 8, 2015 18:32
@sehe still safe if I use the copy initializer from a C string?
Apr 8, 2015 18:31
@sehe any way I can get a leak reassigning that?
Apr 8, 2015 18:31
do I get a leak?
Apr 8, 2015 18:31
std::string name;
name = "foo";
name = "bar";
Apr 8, 2015 18:30
what happens is I reassign a string like
Apr 5, 2015 00:14
@sehe Goodbye
Apr 5, 2015 00:10
my main concern is still mapping vertices, though.
Apr 5, 2015 00:08
if I get to understand it, nice
Apr 5, 2015 00:08
@sehe OK, I'm looking at the presentation
Apr 5, 2015 00:05
@sehe I don't speak German, sorry
Apr 5, 2015 00:04
@sehe thanks
Apr 5, 2015 00:01
@sehe that should tell me something about these libraries
Apr 4, 2015 23:59
seriously, I would offer them more than a good beer
Apr 4, 2015 23:58
@sehe I'm tempted to pay someone to write a decent one
Apr 4, 2015 23:55
any up to date introduction tutorial to Boos::Graph?