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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:16:48+00:00 2026-05-26T03:16:48+00:00

For some reason, I keep getting the following errors in ErrorHandler.h why size function

  • 0

For some reason, I keep getting the following errors in ErrorHandler.h
why size function is missing arguments?

‘std::list<_Ty>::size’: function call missing argument list; use ‘&std::list<_Ty>::size’ to create a pointer to member

    'std::_List_iterator<_Mylist> std::list<_Ty>::erase(std::_List_const_iterator<_Mylist>,std::_List_const_iterator<_Mylist>)' : cannot convert parameter 1 from 'int' to 'std::_List_const_iterator<_Mylist>' 

    'std::_List_iterator<_Mylist> std::list<_Ty>::erase(std::_List_const_iterator<_Mylist>)' : cannot convert parameter 1 from 'int' to 'std::_List_const_iterator<_Mylist>'


// in errorhandler.h

    class ErrorHandler{
        std::list<unsigned int> m_ErrorList;
    public:
        ErrorHandler(){ }
        ~ErrorHandler(){ }
        void ForceShutdown(){ free(&m_ErrorList); }
        void Add(int errCode){ m_ErrorList.push_back(errCode); }
        unsigned int GetLastError(){ if(m_ErrorList.size!=0)return m_ErrorList.back(); }
        void Remove(int pos){ if(m_ErrorList.size!=0)m_ErrorList.erase(pos); }
        void RemoveRange(int start,int end){ if(m_ErrorList.size!=0)m_ErrorList.erase(start,end); }

    };


// in criticalsection.h
    class CriticalSection{
        long m_nLockCount;
        long m_nThreadId;
        typedef CRITICAL_SECTION cs;
        cs m_tCS;
    public:
        CriticalSection(){
            ::InitializeCriticalSection(&m_tCS);
            m_nLockCount = 0;
            m_nThreadId = 0;
        }
        ~CriticalSection(){ ::DeleteCriticalSection(&m_tCS); }
        void Enter(){ ::EnterCriticalSection(&m_tCS);  }
        void Leave(){  ::LeaveCriticalSection(&m_tCS); }
        void Try();
    };
    class LockSection{
        CriticalSection* m_pCS;
        ErrorHandler * m_pErrorHandler;
    public:
        LockSection(CriticalSection* pCS,ErrorHandler* pErrorHandler){
            m_pCS = pCS;
            m_pErrorHandler = pErrorHandler;
            if(!m_pCS)m_pErrorHandler->Add(0x1AE1); // 0x1AE is code prefix for critical section header
            if(m_pCS)m_pCS->Enter();
        }
        ~LockSection(){
            if(!m_pCS)m_pErrorHandler->Add(0x1AE2);
            if(m_pCS)m_pCS->Leave();
        }
    };
  • 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-05-26T03:16:48+00:00Added an answer on May 26, 2026 at 3:16 am

    http://www.cplusplus.com/reference/stl/list/pop_back/
    Nope, pop_back does not return the last element. This is to prevent accidental errors. You have to get the last element explicitly via back(). This way is also faster if you want to pop several without reading them. This also applies to all the other Standard C++ Library containers.

    Judging by your warnings, it looks like you’re also having trouble deleting. For Lists it can be tricky:

    void Remove(int pos){
        std::list<unsigned int>::const_iterator iter = m_ErrorList.begin();
        //no need to check the size, advance will throw an exception if pos is invalid
        std::advance(iter, pos);
        m_ErrorList.erase(iter);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason i keep getting the following error when i try to set
For some reason I keep getting error C3861: '__typeof': identifier not found when I
For some reason, I keep getting a '1' for the file names with this
For some reason, I keep getting XMLDoc is null, in firebug. I think that
For some reason, I keep getting an empty folder called blog generated on my
Hello i am having some problems sending mails thoug my site. I keep getting
i keep getting NullPointerException on this line: SharedPreferences myPreference = PreferenceManager.getDefaultSharedPreferences(this); i ran some
For some reason I never see this done. Is there a reason why not?
For some reason when I attempt to make a request to an Ajax.net web
For some reason when I create a new namespace in Visual Studio 2008 its

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.