-
The Cheeze to Your Macaroni
Virtual keyword
Having trouble seeing what the difference between putting the virtual keyword in a function and not having it all is.
Anybody have an example of how putting the virtual keyword would change the behavior of something?
-
Senior Member
I just looked and found this(hadn't heard of use of the keyword virtual before for ActionsScript): http://stackoverflow.com/questions/3...erformance-hit
So it apparently doesn't matter at the moment.
UnknownGuy
-
The Cheeze to Your Macaroni
Oh alright...thanks that cleared that up. It was starting to bug me, because I've seen it used several times in other people's code. I assume they are just used to using it in C++ so they probably figured they had to use it here.
-
Senior Member
I use the virtual keyword to make it clear which methods I intend to or have overridden. I know that there's no difference to the compiled code, but it's nice to make it really clear.
Just pointing out that there are reasons other than ignorance for using the reserved keywords.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|