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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:57:01+00:00 2026-06-17T10:57:01+00:00

I had a problem, which I eventually reduced down to this simple example: template

  • 0

I had a problem, which I eventually reduced down to this simple example:

template <int dimensions> class Base {
    protected:
        Base(void) {}
    public:
        virtual ~Base(void) {}

        void base_method(void) {}
};
template <int dimensions> class MyClass : public Base<dimensions> {
    public:
        MyClass(void) : Base<dimensions>() {
            base_method();
        }
        ~MyClass(void) {}
};

This compiles fine on MSVC 2010, but fails with g++ 4.6:

main2.cpp: In constructor âMyClass<dimensions>::MyClass()â:
main2.cpp:12:16: error: there are no arguments to âbase_methodâ that depend on a template parameter, so a declaration of âbase_methodâ must be available [-fpermissive]
main2.cpp:12:16: note: (if you use â-fpermissiveâ, G++ will accept your code, but allowing the use of an undeclared name is deprecated)

What’s going on?

  • 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-17T10:57:02+00:00Added an answer on June 17, 2026 at 10:57 am

    you have to do:

    this->base_method();
    

    or

    Base<dimension>::base_method();
    

    Compilers generally will not consider methods in templated base class for function resolution.

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

Sidebar

Related Questions

I had a problem in site map path I had navigation bar which take
We had huge performance problem when deploying our ASP.NET app at a customer, which
I have a big problem. I had a configuration which worked properly till today.
I had this problem before and can't for life of me remember how to
I have a problem similar to this , although hopefully I've narrowed it down
Hello everyone I've never had a problem which i cant solve with google... So
I have a very simple problem which requires a very quick and simple solution
I had problem using a very simple frame containing two JPanel. The problem is
Not too long ago, I had a problem which required me to set WinDbg.exe
I had a problem with updating instance structure which contains repeating nodes. I wanted

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.