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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:43:22+00:00 2026-05-20T12:43:22+00:00

It seems that VS 2008 handles class templates with inheritance a bit differently from

  • 0

It seems that VS 2008 handles class templates with inheritance a bit differently from the other compilers.
The following code compiles without any error on VS 2008 (with default options):

template <typename S, typename T>
class someclass : public non_existent_class
{
T operator() (S s) const {
    return T(s);
}
};

Question is, why? No other compiler has been able to do this (tried GCC 4.5.0, Intel, Online Comeau, VS 2005), because of undefined identifier non_existent_class. Maybe it is something in the new C++0x standard that justifies this behavior?

  • 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-20T12:43:23+00:00Added an answer on May 20, 2026 at 12:43 pm

    This is most likely a consequence of the fact that visual studio does single phase name lookup when it’s supposed to do two phase. The non-dependent name “non_existent_class” should fail in the first phase, which happens at the point of definition whether or not the template is ever instantiated.

    It’s a bug, but it’s one that is never, ever going to be fixed until MS fundamentally changes the way their compiler works wrt templates.

    http://womble.decadent.org.uk/c++/template-faq.html#two-phase

    http://blog.llvm.org/2009/12/dreaded-two-phase-name-lookup.html

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

Sidebar

Related Questions

I have the following scenario (Asp.net 3.5, Windows Server 2008 R2, IIS7): User1 logs
I've got an issue involving a website that I have been using VS 2008
I have a third party library that is available for download in either 32-bit
We provide a webservice to a third-party that expects a 500 error when an
It often happens that a single C# solution contains some projects that are x86-specific
If I'm creating a new project in unmanaged C++, Visual Studio 2008 or greater,
I'm really having trouble closing my console application with FreeGLUT. I would like to
So, I am trying to learn how to set up good, and usable databases.
I can upload a video to my drupal instance, but when I try to
I can't seem to find any walk-trough on how to create a MFC DLL

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.