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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:43:51+00:00 2026-06-07T04:43:51+00:00

I was searching for something else related to template template parameters and happened upon

  • 0

I was searching for something else related to template template parameters and happened upon this answer which claims that template template template parameters are not allowed by the standard.

However, the following code compiles in the latest clang (3.2) and the latest GCC (4.8):

template<template<template<typename> class> class T> struct test {};
template<template<typename> class T> struct foo {};
test<foo> bar;

Is this an extension, or is the other answer actually incorrect and it is allowed by the standard? If not, is there any particular reason for the omission?

  • 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-07T04:43:54+00:00Added an answer on June 7, 2026 at 4:43 am

    In std::vector<int> the class template std::vector is passed the type int as a parameter. In std::get<42>(some_tuple), the function template std::get is passed the value 42 as a parameter. Perhaps unimaginatively the former kind of argument is called a type argument of a template (or template type argument) while the latter kind is a (template) non-type argument.

    But templates can also accept another kind of arguments: other templates. For instance template<template<typename> class T> void foo(); declares a function template taking a template as argument, that itself takes a type argument. (As a note, while templates are not types the term ‘non-type argument’ still does not cover template template arguments. It is reserved for arguments like template<int NonTypeArgument>.)

    Since there is no such thing as a template template in C++ (there are class, function, and alias templates — but they’re collectively simply ‘templates’ anyway), there is no such thing as a template template template parameter. What you have is a run off the mill template template parameter, where the expected template argument has a template template argument itself. I cannot find a reference in the Standard that forbids this, like the answer you link claims.

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

Sidebar

Related Questions

I'm searching a while for this and I can't found something that works for
I remember reading something once, but could not find it now while searching, if
Searching here I found that this question was already asked , but I think
I've been searching for hours to find a regex that does this for me,
I have been searching for a jquery plugin or something else to create a
Searching around I haven't found any recent answers to this question. The other answers
Searching for values that uses the same value Example SELECT Name, UnitPrice, Quantity, Color
Searching for a way to add this code, after the <head> (or some <link
this is a PHP related question. I have searched far and wide for a
I have been searching for a while for a DOCTYPE tag that will make

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.