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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:25:01+00:00 2026-05-26T06:25:01+00:00

Can i call a member template, template template member function? or how can I

  • 0

Can i call a member template, template template member function? or how can I know to call it member template and how does it make sense?

For example:

For case A: I have a class, if I make its member function a template member function, would i call it a member template?

For case B: I have a template class, If I make its template member function a template, would I call it a member template or can I call it template template member function?

  • 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-26T06:25:01+00:00Added an answer on May 26, 2026 at 6:25 am

    For both cases you call it member template.

    template<typename T>
    struct A {
      // this is not a template
      void f();
    
      // but this is a member template
      template<typename T> void g();
    };
    

    It’s a member template because it’s a member that is a template. The member function f is not a template, but is a member function of a class template. In C++ there is unfortunately not a clear terminology for such a thing, so it happens that certain rules are formulated in the Standard to apply for templates, but are intended to apply also for member functions of class templates. And many rules need to enlist all the joyful combinations like

    function template
    member function of class template
    member function of nested class of a class template
    member function template 
    ...
    

    Same applies for member classes of class templates. It has been proposed to call member functions/classes of class templates temploid or something like that. Work is under way to fix this state of affairs, though.

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

Sidebar

Related Questions

I know I can call the GetVersionEx Win32 API function to retrieve the Windows
I want to specialize following member function: class foo { template<typename T> T get()
For some reason I can't seem to call my global template function in GCC
Can I call a non-member static templated function from a static member function where
Using a delegate I can call any function asynchronously. From the documentation I understand
(Yes I know I can call Java code from Scala; but that is pointless;
I know I can call it whatever, but just like there is a convention
How can I bind arguments to a Python function so that I can call
I'm trying to create a template class, and when I define a non-member template
I have the following class template: template<class T, unsigned N> class MyClass; where T

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.