dynamic_cast vs static_cast-polymorphism 99% sure its solved
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: dynamic_cast vs static_cast-polymorphism 99% sure its so
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
Re: dynamic_cast vs static_cast-polymorphism 99% sure its so
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.
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.
Chili
- SpaceAnimation
- Posts: 245
- Joined: July 15th, 2013, 3:31 am
Re: dynamic_cast vs static_cast-polymorphism 99% sure its so
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 (err, or was it the keyb stuff? eh, i forget )
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 --
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 --
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: dynamic_cast vs static_cast-polymorphism 99% sure its so
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.
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
Re: dynamic_cast vs static_cast-polymorphism 99% sure its so
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?
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
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: dynamic_cast vs static_cast-polymorphism 99% sure its so
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
- SpaceAnimation
- Posts: 245
- Joined: July 15th, 2013, 3:31 am
Re: dynamic_cast vs static_cast-polymorphism 99% sure its so
Nothing wrong with kissing hands and shaking babies.
To strive, to seek, to find, and not to yield.
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: dynamic_cast vs static_cast-polymorphism 99% sure its so
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