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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:16:47+00:00 2026-06-12T12:16:47+00:00

Can`t I perform typedef inside the class? #include <vector> using namespace std; class List

  • 0

Can`t I perform typedef inside the class?

#include <vector>
using namespace std;
    class List {
    public:
           typedef int Data;
           class iterator;
           pair<iterator,bool> insert(const Data nodeId); //<-error
    private:
    class Node {
        typedef vector<NodeId> DepList;//<-error
    };
    }

I get an error missing type specifier - int assumed. Note: C++ does not support default-int

  • 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-12T12:16:48+00:00Added an answer on June 12, 2026 at 12:16 pm

    You can.

    I guess the error is on the line with the pair. Have you included the right header:

    #include <utility>
    

    Also, if you don’t have using namespace std; or usgin std::pair;, you need to write std::pair, instead of just pair.

    P.S. Please, don’t use using namespace std;, especially header files.

    EDIT Looking at your edit, you need #include <vector>, too.
    EDIT2: You haven’t defined NodeId, but you have used it for the typedef

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

Sidebar

Related Questions

Using the JavaScript Native Interface of GWT I can perform the following: public native
I can perform an adf test on a vector: library(tseries) ht <- adf.test(vector, alternative=stationary,
For example, using resharper in c# code I can perform a 'Move to resource'
For a class assignment, I am required to mergeSort a vector using its iterators.
As i can perform asynchronous operations using delegates,i suspect there is a thin chance
I know that I can perform divide by 2 using right shift. For simplicity,
I am developing an app where users can perform CRUD operations on multiple data
Is there any JavaScript library which can perform search on custom data. Something like
class MyAwesomeClass def foobar puts trip! end So that I can perform : MyAwesomeClass.foobar
How can I perform web.config transformations using Visual Studio 2008? Someone had asked me

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.