#bitfighter IRC Log

Index Search ←Prev date Next date→

IRC Log for 2015-08-31

Timestamps are in GMT/BST.

00:10:01DiannaAgron Quit (Quit: Leaving)
00:10:49Flynn Quit (Quit: This computer has gone to sleep)
00:25:26Nothing_Much has joined
01:35:37Nothing_Much Quit (Quit: Leaving)
03:32:47Darrel Quit (Read error: Connection reset by peer)
03:40:45LordDVG Quit (Remote host closed the connection)
03:50:18Darrel has joined
05:18:07koda has joined
05:27:53Darrel Quit (Ping timeout: 272 seconds)
05:28:14Darrel has joined
06:02:58koda Quit (Ping timeout: 260 seconds)
06:04:33koda has joined
06:56:33kodabb has joined
06:57:18koda Quit (Ping timeout: 244 seconds)
06:59:07koda has joined
07:01:18kodabb Quit (Ping timeout: 260 seconds)
07:05:02koda Quit (Ping timeout: 260 seconds)
07:08:15koda has joined
07:13:16kodabb has joined
07:14:23koda Quit (Ping timeout: 244 seconds)
07:14:23kodabb is now known as koda
07:17:01kodabb has joined
07:20:02koda Quit (Ping timeout: 264 seconds)
07:20:19kodabb is now known as koda
07:24:15kodabb has joined
07:26:53kodabb_ has joined
07:27:07koda Quit (Ping timeout: 250 seconds)
07:29:12kodabb Quit (Ping timeout: 268 seconds)
07:29:30koda has joined
07:31:40kodabb_ Quit (Ping timeout: 268 seconds)
07:33:56kodabb has joined
07:35:22koda Quit (Ping timeout: 268 seconds)
07:35:22kodabb is now known as koda
07:41:29kodabb has joined
07:44:14koda Quit (Ping timeout: 260 seconds)
07:44:14kodabb is now known as koda
09:27:23Nothing_Much has joined
10:29:00Nothing_Much Quit (Remote host closed the connection)
12:28:30kodabb has joined
12:30:13koda Quit (Ping timeout: 240 seconds)
12:31:11Nothing_Much has joined
12:32:09koda has joined
12:33:08kodabb Quit (Ping timeout: 252 seconds)
12:34:53kodabb has joined
12:37:32koda Quit (Ping timeout: 252 seconds)
12:37:46kodabb_ has joined
12:40:05Nothing_Much Quit (Quit: Leaving)
12:40:06kodabb Quit (Ping timeout: 252 seconds)
12:40:20Nothing_Much has joined
12:41:02koda has joined
12:43:24kodabb_ Quit (Ping timeout: 252 seconds)
12:43:42kodabb has joined
12:45:44koda Quit (Ping timeout: 250 seconds)
12:48:01koda has joined
12:49:12kodabb Quit (Ping timeout: 250 seconds)
12:53:02kodabb has joined
12:55:01koda Quit (Ping timeout: 272 seconds)
12:56:23koda has joined
12:58:13kodabb Quit (Ping timeout: 240 seconds)
12:59:16watusimoto has joined
12:59:16ChanServ sets mode +o
13:43:37Nothing_Much Quit (Remote host closed the connection)
13:45:57Nothing_Much has joined
13:46:16Nothing_Much Quit (Read error: Connection reset by peer)
13:47:12Nothing_Much has joined
15:05:57Nothing_Much Quit (Remote host closed the connection)
15:26:03koda Quit (Quit: koda)
17:20:55fordcars has joined
18:20:24koda has joined
19:51:29DiannaAgron has joined
20:47:14DiannaAgron Quit (Read error: Connection reset by peer)
20:54:03DiannaAgron has joined
21:09:39koda Quit (Quit: koda)
21:19:37raptor has joined
21:19:37ChanServ sets mode +o
21:22:14raptorgood day!
21:55:46watusimoto Quit (Quit: Leaving.)
22:26:31fprdcars has joined
22:27:06fordcarsHi!
22:27:12fordcarsDidn
22:27:17fprdcars Quit (Client Quit)
22:27:20fordcarsOops
22:27:23raptorhi
22:27:58fordcarsHey raptor, if you have a pointer pointing to an object, and that object dies (gets destroyed), that pointer is null, right?
22:28:10raptornope!
22:28:15raptorthat's the fun of c
22:28:17fordcarsHah!
22:28:26raptorit still points to the same memory address
22:28:56fordcarsSo how do you check if it is still valid?
22:29:03raptorso when accessed again, aftter the object is destroyed, then it may call up some random chunk of memory and mess everything all up
22:29:07raptorah ha
22:29:12fordcarsHaha
22:29:15fordcarsOk
22:29:27raptorto address this issue, you use what's called a safe pointer
22:29:48raptoror a 'smart pointer'
22:29:52fordcarsOooo this
22:30:04fordcarsYes I used one somewhere
22:30:06raptorthey keep track of the object and when it is destroyed, they set themselves to NULL
22:30:27fordcarsBut I didn't use one this time because I thought I didn't need to for a const pointer
22:30:33fordcarsUh, pointer to a const
22:31:05raptorif you're not writing really tiny code and are pressed for memory or performance, the standard thing to do is always use a smart pointer
22:31:26fordcarsOkok
22:31:40raptorif you're coding in c++11, then I think there's a standard one to use
22:31:56fordcarsYeah, std::pointerss
22:32:02fordcarsBut I am not sure wich one to take
22:32:04raptorlike this one: http://en.cppreference.com/w/cpp/memory/shared_ptr
22:32:24fordcarsconst Class *instance; is my pointer
22:32:42fordcarsOh I guess it would be shared
22:32:53raptorif you only access the object through *one* pointer, then use std::unique_ptr
22:32:57fordcarsOh
22:33:08fordcarsBut I don't want to ever delete this object by this pointer
22:33:16fordcarsIt must be read only
22:33:24raptorthe pointer or object?
22:33:28fordcarsThe object
22:33:38fordcarsThe object is stored in a map
22:33:47fordcarsAnd the pointer is a const pointer pointing to it
22:33:52fordcarsFor read-only
22:34:05raptorconst can be applied to both the object and the pointer
22:34:49raptorif you don't ever want it destroyed, then perhaps you should make it a static object and just provide access to it via some method
22:36:15fordcarsSorry it must only be destroyed by the map
22:36:45fordcarsBut not by the pointer
22:36:52raptormap<shared_ptr<Class> > myMap
22:37:18fordcarsRight now the map is actually holding actual objects
22:37:20raptorthese are the kind of talks that start me second-guessing myself
22:37:27fordcarsHaha
22:37:53fordcarsOk let me make myself a bit clearer I suck at being clear
22:37:54raptorwell, maybe the actual objects should be wrapped in a shared_ptr
22:37:58fordcarsThe map:
22:38:07fordcarsraptor: you think?
22:38:21raptorthat way access can be like you want
22:38:28raptoryeah - we do that somewhere in bitfighter, too
22:38:45raptorlike in the editor, have a vector<shared_ptr<BfObject> >
22:39:04fordcarsOh interesting
22:40:16fordcarsAnd shared_ptr would be the right pointer for this
22:40:22raptoryes
22:40:33fordcarsSince it wouldn't deconstruct the object unless all of them are gone
22:40:43raptorcorrect
22:40:51fordcarsThat is some cool stuff
22:41:21fordcarsThanks raptor!
22:41:34raptorsure... i hope something i said is right :)
22:41:43fordcarsMe too :)
22:41:56fordcarsBut it is probably right
22:42:02fordcarsComing from you ;)
22:42:49raptorhah! I think I'd confirm with coding first...
22:42:55fordcarsHahaha
22:43:03fordcarsYes I will :)
22:43:20fordcarsWell tomorrow night, school starts tomorrow, better go to bed early(er)
22:44:37fordcarsSo night!
22:44:43fordcars Quit (Quit: Page closed)
23:27:39raptor Quit ()

Index Search ←Prev date Next date→

These logs were automatically created by BFLogBot on irc.freenode.net.