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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:24:24+00:00 2026-06-08T22:24:24+00:00

Goal : To inherit from a class with 2 template parameters. Error Error error

  • 0

Goal: To inherit from a class with 2 template parameters.

Error

Error error C2143: syntax error : missing ‘,’ before ‘<‘

The Code

template< typename Type >
class AssetManager : public IsDerivedFromBase< Type, Asset* >
{
    // Class specific code here
};

Things you need to know: Asset is a class that just wraps a char* with a getter/setter and IsDerivedFromBase will be used to basically test wether or not Type is a derivative of Asset. These sets of classes are isolated in there own small scale visual Studio 2012 project and will be integrated into the main project once all the functionality has been tested thoroughly.

Some Edits based on Comments

Thank you for the help so far, I really appreciate it. Here are some more specifics:

IsDerivedFromBase.h

#ifndef ISDERIVEDFROMBASE_H
#define ISDERIVEDFROMBASE_H

#include< iostream > // For access to NULL

namespace Fenrir
{
    template< typename Type, typename Base >
    class IsDerivedFromBase
    {
    private:
        static void Constraints( Type* _inheritedType )
        {
            Base* temp = NULL;

            // Should throw compiler error if
            // this assignment is not possible.
            temp = _inheritedType;
        }

    protected:
        IsDerivedFromBase( ) { void( *test )( Type* ) = Constraints; }
    };
}

#endif

Note: This class was based off of a class I read about in an article. I have since found a better way to achieve the desired result; however, I wish to understand where this error is stemming from.

AssetManager.h”

#ifndef ASSETMANAGER_H
#define ASSETMANAGER_H

#include "IsDerivedFromBase.h"

namespace Fenrir
{
    template< typename Type >
    class AssetManager : public IsDerivedFromBase< Type, Asset* >
    {
        // Class specific code
    };
}

#endif

Keeping class specific code to a minimum to keep this post as neat as possible, if more info is needed just let me know and I can add it in :).

  • 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-08T22:24:25+00:00Added an answer on June 8, 2026 at 10:24 pm

    Solved my issue which was interestingly silly. So due to a comment (from Jesse Good) I took a quick look at my includes. Since this was a small “whip it up quick” kind of project I didn’t really pay much attention to them. I don’t know exactly where the error was occuring, but I found out that AssetManager did not know about IsDerivedFromBase so I set up the following code block to just solve that issue without having to write a bunch of
    #include statements everywhere!

    // Contact point houses all of the include files
    // for this project to keep everything in one place.
    
    #ifndef CONTACTPOINT_H
    #define CONTACTPOINT_H
    
    #include "Asset.h"
    #include "Sprite.h" 
    #include "IsDerivedFromBase.h"
    #include "GenericManager.h"
    #include "AssetManager.h"   
    
    #endif
    

    Now I just include this in every header and all is well. I’ve been programming C++ for a little over a year now and never ran into this, a good lesson to learn for anyone new programming.

    Thanks for your help everyone : )

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

Sidebar

Related Questions

Goal: Produce an Excel document with information from 3 associated models that is similar
Is it possible to subclass and inherit from javascript Arrays? I'd like to have
I have written a custom SessionStoreProvider class that inherits from the SessionStateStoreProviderBase. I have
I've got a base class from an outside library that I can't modify -
Goal: To launch VLC player through PHP code, and play the specified video in
In the included configuration, does the stop-jetty execution inherit any configuration information from the
I'm getting an error in .net when trying to declare a Public class on
Goal: Show data from server in wxPython GUI on client Newcomer to Twisted. I
Goal : I wants when I drag image it become fade so we can
Goal is to make a dialog that appears on menu_key pressed, but it keeps

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.