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 8992369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:56:17+00:00 2026-06-15T22:56:17+00:00

By C++11 standard std::is_base_of<B, D> must return true if D is derived from B

  • 0

By C++11 standard std::is_base_of<B, D> must return true if D is derived from B or if both are the same non-union class. But in VC++ 2010 stl implementation template return true if the type B is a ONLY base class of the type D! Is it a bug ?

At http://msdn.microsoft.com/en-us/library/bb982243(v=vs.100).aspx page in example section

std::is_base_of<base, base> == true

but this does not correspond VC++2010 STL implementation. Although it is consistent with the requirement of the C++11 standard. Where is a bug ?

  • 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-06-15T22:56:18+00:00Added an answer on June 15, 2026 at 10:56 pm

    is_base_of<int, int>::value evaluates to false (your comment indicates that this is the actual question you have) because is_base_of<>::value can evaluate to true only if the template parameters are class types. The C++11 standard’s Table 51 – Type relationship predicates (C++ 20.9.6 “Relationships between types”) defines is_base_type<> to evaluate to true if and only if (emphasis added):

    Base is a base class of Derived without regard to cv-qualifiers or Base and Derived are not unions and name the same class type without regard to cv-qualifiers

    The C++11 standard even has the following as one of its examples (C++11 20.9.6/3):

    is_base_of<int, int>::value // false
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

C++11, §9/7: A standard-layout class is a class that: has no non-static data members
In standard library, I found that namespace std is declared as a macro. #define
I'm looking for a standard dual-map structure - is there one implemented in std/boost/another
If all of the members of std::tuple are of standard layout types , is
Why definition of std::function<>::operator() in the C++ standard is: R operator()(ArgTypes...) const; and not
I am reading the IEEE Standard Verilog Hardware Description Language (specifically IEEE Std 1364-2001)
I've made a function dump_text(std::ostream &) that dumps some text in a standard output
Maybe even better is: Why does the standard require forwarding to a base class
I have a class test which isn't standard constructable nor assignable due to certain
I am playing around with the auto feature in the C++0X standard but I

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.