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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:22:47+00:00 2026-06-13T04:22:47+00:00

I am trying to define a class class BTree { private: map<std::string,BTree*> *node; public:

  • 0

I am trying to define a class

class BTree
{
private:
     map<std::string,BTree*> *node;
public:

    BTree(void);
    ~BTree(void);
    void Insert(BTree *);
};

on compiling the code the compiler gives me an error

error C2899: typename cannot be used outside a template declaration  
error C2143: syntax error : missing ';' before '<'  
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int  
error C2238: unexpected token(s) preceding ';'  
error C2899: typename cannot be used outside a template declaration  

I have tried to change the map to something simple like map<int,int> node it still gives me the same error. Am I missing something ?

  • 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-13T04:22:48+00:00Added an answer on June 13, 2026 at 4:22 am

    This is likely because you don’t have the std namespace listed in a using. The type map isn’t in the global namespace so so map isn’t resolvable. Try the following

    class BTree {
    private:
      std::map<std::string, BTree*> *node;
    
      ...
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I`m trying to define a variable of string type in a class definition in
I'm trying to define a generic class public abstract class RepositoryBase<TDatabase, TKey, T> :
I'm trying to define base class, which contains typedef's only. template<typename T> class A
I am trying to define an abstract class that has operators to compare two
I'm stuck. I'm trying to dynamically define a class method and I can't wrap
I am trying to define in python a class B, subclass of A, that
I'm trying to define a simply Fraction class And I'm getting this error: python
I am trying to define a composite PK for a class where one of
I'm trying to define my own (very simple) exception class in Python 2.6, but
In my following code. I am trying to assign a different theOperator string to

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.