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

  • SEARCH
  • Home
  • 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 7492661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:30:23+00:00 2026-05-29T16:30:23+00:00

namespace std { class type_info { public: virtual ~type_info(); //type_info can serve as a

  • 0
namespace std {
 class type_info
 {
 public:
  virtual ~type_info(); //type_info can serve as a base class
 // enable comparison
  bool operator==(const type_info& rhs ) const;
 // return !( *this == rhs)
  bool operator!=(const type_info& rhs ) const;
  bool before(const type_info& rhs ) const; // ordering
 //return a C-string containing the type's name
  const char* name() const;
 private:
  //objects of this type cannot be copied
     type_info(const type_info& rhs );
     type_info& operator=(const type_info& rhs);
 }; //type_info
}  

In the declaration of type_info class ,I can’t find any data member .So what is constructed or destructed ?? Also typeid isn’t declared in it.So how type_info object is accessed by it?
Is above representation incomplete? Please tell about the type of data member in type_info class

  • 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-29T16:30:24+00:00Added an answer on May 29, 2026 at 4:30 pm

    It looks like you are looking at the public interface of typeinfo from C++03. The standard doesn’t restrict an implementation from adding members to a standard class (so long as there names come from those reserved to the implementation) to make things work.

    In the implementation that I am currently using std::typeinfo has a private member const char* __name which is used to implement the public member functions according to the requirements of the standard.

    ISO/IEC 14882:2011 17.5.2.3 Private members [objects.within.classes] / 1:

    Clauses 18 through 30 and Annex D do not specify the representation of classes, and intentionally omit specification of class members (9.2). An implementation may define static or non-static class members, or both, as needed to implement the semantics of the member functions specified in Clauses 18 through 30 and Annex D.

    Similar wording appears in C++03 17.3.2.3.

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

Sidebar

Related Questions

#include <iostream> using namespace std; class Base { public: Base(){cout <<Base<<endl;} virtual ~Base(){cout<<~Base<<endl;} virtual
using namespace std; class A { public: A() {} ~A() {} map<int, string*>& getMap()
In the sample: #include <iostream> using namespace std; class B { public: virtual void
#include<iostream> using namespace std; class A { int a; int b; public: void eat()
#include <iostream> using namespace std; struct testarray{ int element; public: testarray(int a):element(a){} }; class
Example code: #include <cstdlib> #include <iostream> using namespace std; class A { public: A(int
//using namespace std; using std::ifstream; using std::ofstream; using std::cout; class Dog { friend ostream&
1st code: #include <iostream> using namespace std; class demo { int a; public: demo():a(9){}
include stdafx.h #include <iostream> using namespace std; class Foo{ public: void func() { cout<<Hello!!<<endl;
I've recently been working with code that looks like this: using namespace std; class

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.