Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6029655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:55:08+00:00 2026-05-23T04:55:08+00:00

Is it generally considered bad practice to use typeid in production code? Also, I

  • 0

Is it generally considered bad practice to use typeid in production code? Also, I noticed typeid returns type_info, which includes some metadata (such as a string with the type’s name); is there a way to deactivate this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:55:08+00:00Added an answer on May 23, 2026 at 4:55 am

    It’s hard to say whether the use of a particular language feature is “bad” or “good.” It really depends on how you use it. There’s nothing inherently wrong with using typeid if it’s the right tool for the job, but if there’s a better solution to whatever problem you’re solving, then you should avoid using typeid in favor of that better solution.

    It is often not a good idea to use typeid because its use can often be avoided by using inheritance and virtual functions. If you can update your system in this way, then it might be a good idea to do so.

    As for whether you can have typeid avoid returning a std::type_info, this shouldn’t cause any performance problems. typeid evaluates to a const std::type_info&, so it doesn’t deep-copy any of the string information it contains. Most implementations have the actual std::type_info object stored in the object’s virtual function table, so no copying is done internally.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it generally considered a bad practice to use non-exhaustive pattern machings in functional
Is it generally considered bad practice to provide Iterator implementations that are infinite; i.e.
Is it considered good or bad practice to use MySQL's password function to hash
It seems to be generally considered poor programming practise to use variable names that
When desinging UI for mobile apps in general which resolution could be considered safe
Generally when I use ClickOnce when I build a VB.NET program but it has
Generally, how bad of a performance hit is storing a file in a database
I generally use a manual process: Look at the page, figure out the semantic
I generally stay away from regular expressions because I seldom find a good use
In my naming convention, I use _name for private member variables. I noticed that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.