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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:22:37+00:00 2026-06-16T03:22:37+00:00

Sorry for the confusing title, but I’ll try to elaborate more here. I haven’t

  • 0

Sorry for the confusing title, but I’ll try to elaborate more here. I haven’t been able to find this particular problem via searching, so if I have missed it please point me to the right thread…

I have a class template dependent on one parameter which I am using as a base class:

template <class TVertex>
class DrawExecutorDX11
{
public:
    DrawExecutorDX11( );
    virtual ~DrawExecutorDX11( );
    void AddVertex( const TVertex& vertex );

protected:
    TGrowableVertexBufferDX11<TVertex> VertexBuffer;
};

What I want to do is to inherit from this class template, and at the same time add another class template parameter to the sub-class. My attempt at the syntax would be something like this:

template <class TVertex, class TInstance>
class DrawInstancedExecutorDX11<TInstance> : public DrawExecutorDX11<TVertex>
{
public:
    DrawInstancedExecutorDX11( );
    virtual ~DrawInstancedExecutorDX11( );

    void AddInstance( const TInstance& data );

protected:
    TGrowableVertexBufferDX11<TInstance> InstanceBuffer;
};

I am hoping that this configuration would allow me to declare an instance of the subclass template like so:

DrawInstancedExecutorDX11<VertexStruct,InstanceStruct> myExecutor;

However, VS2012 doesn’t even consider compiling the sub-class and indicates that it is expecting a semi-colon after class DrawInstancedExecutorDX11. To be perfectly honest, I haven’t ever tried this type of template arrangement before, so I am wondering if anyone else has done this. If so, is there a basic syntax mistake that I am making or some other gotcha? Thanks in advance for any help or guidance you can give!

  • 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-16T03:22:38+00:00Added an answer on June 16, 2026 at 3:22 am

    If you use any angled-brackets right after the class name, you are declaring a template specialization, not the primary template. The correct primary class template is:

    template <class TVertex, class TInstance>
    class DrawInstancedExecutorDX11 : public DrawExecutorDX11<TVertex>
    {
        //...
    };
    

    Inside that class you can refer to template parameters TVertex and TInstance, and outside that class you can use DrawInstancedExecutorDX11<SomeVtxType, SomeInstType>.

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

Sidebar

Related Questions

Sorry for the confusing title, but it basically says it all. Here's the structures
Sorry if the title sounds confusing - but this is what I am trying
Sorry for the confusing title :P I'm sure I should know this but I
Sorry for the confusing title, but I couldn't find a better way to explain
I'm sorry if the title is a bit confusing, but this is my problem:
I'm sorry if the title is quite confusing but I am wondering if it's
Sorry for the somewhat confusing title. Not sure really how to title this. My
Sorry about the confusing title. I recently started doing this in my project, and
Sorry for the confusing title, but I'm not sure what to call those. I'm
Sorry if the title is confusing but I'm trying to get all comments and

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.