15,885,010 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Sebastian Krysmanski (Top 5 by date)
Sebastian Krysmanski
10-Feb-12 4:37am
View
Deleted
1. RTTI has nothing to do with virtual methods.
2. It's just an example that's not meant to be complete. It's stripped down to show the essential code.
3. "equals()" compares whether two instances (not types) are the same. The comparison isn't shown in the example (as it depends on the class' implementation - again, it's just an example). However, if the types are different, the instances can't be the same.
4. That's a good point.
Sebastian Krysmanski
8-Feb-12 3:15am
View
Deleted
Unfortunately my code didn't allow for the base class to have a template parameter. This is why I "invented" my solution.
Sebastian Krysmanski
8-Feb-12 3:13am
View
Deleted
Is this faster than my method? It is surely safer, but my goal was to have a fast solution.
Sebastian Krysmanski
8-Feb-12 3:12am
View
Deleted
This only works if the base class (which is missing in your example) knows the template parameter type(s). In my example, however, this isn't the case and is actually the point of the whole tip.
Sebastian Krysmanski
8-Feb-12 3:09am
View
Deleted
I should have written that this is supposed to be a very fast method of comparing types in cases where you have complete control over the implementation of all classes that are inheriting from BaseClass (like with private classes). Of course you can completely break this thing by not correctly overloading "classId()" but again, this method was meant to be fast and not to be dummy-safe.