dynamic_cast vs static_cast-polymorphism 99% sure its solved

The Partridge Family were neither partridges nor a family. Discuss.
albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: dynamic_cast vs static_cast-polymorphism 99% sure its so

Post by albinopapa » April 23rd, 2014, 4:25 am

I thought it only threw bad_cast if it's dealing with references otherwise returns NULL?
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: dynamic_cast vs static_cast-polymorphism 99% sure its so

Post by chili » April 25th, 2014, 3:21 am

static_cast
dynamic_cast
const_cast
reinterpret_cast

For a while I figured maybe I should eventually transition from c-style casts to c++ casts. But you know what, fuck that shit. That shit is dumb. :P
Chili

User avatar
SpaceAnimation
Posts: 245
Joined: July 15th, 2013, 3:31 am

Re: dynamic_cast vs static_cast-polymorphism 99% sure its so

Post by SpaceAnimation » April 25th, 2014, 9:11 am

:o :? :shock: :lol: LOL
Spacey :geek:

User avatar
LuisR14
Posts: 1248
Joined: May 23rd, 2013, 3:52 pm
Location: USA
Contact:

Re: dynamic_cast vs static_cast-polymorphism 99% sure its so

Post by LuisR14 » April 25th, 2014, 5:03 pm

hehe, during the lesson in which you were editing the mouse classes i used const_cast instead of making the MouseServer variable it had non-const :P(err, or was it the keyb stuff? eh, i forget :P)
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat :mrgreen: --

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: dynamic_cast vs static_cast-polymorphism 99% sure its so

Post by albinopapa » April 28th, 2014, 3:13 am

chili wrote:static_cast
dynamic_cast
const_cast
reinterpret_cast

For a while I figured maybe I should eventually transition from c-style casts to c++ casts. But you know what, fuck that shit. That shit is dumb. :P

I'm so glad you don't have an elitest mentality about this stuff. After this post and camerons I started looking around and of course ended up on stack over flow and people there were saying that you can spot programmers transitioning from C by their use of (int) C-style casting. After reading a lot of their posts, which there is an abundance of useful information over there if the questions ever get answered, there are a lot of uppity programmers. Some will say, RTFM, try it and see for yourself and so on. Chili you have a nice thing going here bro. Even when you are done with tutorials, I hope you never leave, unless it's for family sake of course.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: dynamic_cast vs static_cast-polymorphism 99% sure its so

Post by chili » April 28th, 2014, 3:42 am

Stackoverflow is an amazing resource that I refer to almost daily. That being said, there is a lot of groupthink conformity and elitism there, and you need to take everything you read with a grain of salt. I like shiny new programming constructs as much (or moreso) than the next guy, but I've weighed the pros and cons and I just can't justify the pain in the assery of using C++ casts.

And hey man, as long as this community has quality members such as yourself participating, this is where you'll find me. Bro hug?
Chili

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: dynamic_cast vs static_cast-polymorphism 99% sure its so

Post by albinopapa » April 28th, 2014, 5:23 am

Chili is out kissing babies tonight.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
SpaceAnimation
Posts: 245
Joined: July 15th, 2013, 3:31 am

Re: dynamic_cast vs static_cast-polymorphism 99% sure its so

Post by SpaceAnimation » April 28th, 2014, 6:49 am

Do it for the love ... haha
Spacey :geek:

User avatar
jkhippie
Posts: 218
Joined: March 24th, 2014, 5:11 pm

Re: dynamic_cast vs static_cast-polymorphism 99% sure its so

Post by jkhippie » May 12th, 2014, 7:41 pm

Nothing wrong with kissing hands and shaking babies.
To strive, to seek, to find, and not to yield.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: dynamic_cast vs static_cast-polymorphism 99% sure its so

Post by albinopapa » May 14th, 2014, 6:51 am

jkhippie wrote:Nothing wrong with kissing hands and shaking babies.

Lord help your kids.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Post Reply