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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:44:21+00:00 2026-06-18T17:44:21+00:00

The following class template Sequencer contains a nested class template Process , with two

  • 0

The following class template Sequencer contains a nested class template Process, with two template arguments.

template<typename P>
struct Sequencer
{   
    template<typename A , bool = A::CAN_BE_BUFFERED>
    struct Process;
};

I would like to specialize Sequencer for a custom struct Foo while specializing its own version of Process to support just one template argument as follows

template<>
struct Sequencer<Bar>
{   
    template<typename A>
    struct Process;
};

As the implementation is too long, I’ve posted the entire listing on ideone.

On GCC 4.5.3 I get the following error message

prog.cpp:60:24: error: partial specialization ‘Sequencer<Bar>::Process<A>’ does not specialize any template arguments

On Visual Studio 2008 I get the following error

prog.cpp(62) : error C2753: 'Sequencer<Bar>::Process<A>' : partial specialization cannot match argument list for primary template
  • 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-18T17:44:22+00:00Added an answer on June 18, 2026 at 5:44 pm

    Sequencer<Bar>::Process is a full template, it is not a specialization. It just happens to be a member of a specialization. You shouldn’t be declaring it as a specialization:

    template<typename A>
    struct Sequencer<Bar>::Process/*<A>*/
                                   //^ remove this
    {
    };
    

    Templates should be thought of as “class generators”. Sequencer<P> defines a way to make classes from an arbitrary P, where Sequencer<Bar> gives a particular class to generate when Sequencer<Bar> is instantiated. Each generated class is totally separated and unrelated (beyond having been created by the same generator). In this case, this means that the inner class in Sequencer<Bar> has no relationship with the inner class in Sequencer<P>.

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

Sidebar

Related Questions

I have the following traits class template<typename T> struct FeatureType; and I'm using it
I have the following template class : template <typename T> struct timer { T
I have the following class template<typename hi_t, typename lo_t> struct int_t { hi_t hi;
Problem Consider the following class template <typename T> struct A { T x; };
Suppose I have the following class template: template<typename T> struct Wrapper { T* t_;
I have the following class: template <typename T> class matrix { private: int _n;
I have the following class definition: template<typename QueueItemT> class QueueBC { protected: QueueBC() {}
I have the following code: class TimeOutException {}; template <typename T> class MultiThreadedBuffer {
I really like the following template to create properties for class in VS2005 Type
Given the following code sequence: #include <iostream> using namespace std; template <typename T> class

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.