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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:55:53+00:00 2026-06-06T09:55:53+00:00

I have the declaration (or similar) std::map< std::string, Stock*> &stocks; throughout my code. Eclipse

  • 0

I have the declaration (or similar)

std::map< std::string, Stock*> &stocks;

throughout my code. Eclipse does not like this and produces a “Invalid template arguments” error.

Stock is declared as:

class Stock {

 public:
    Stock(std::string, qbbo::Financial_status_indicator, qbbo::Security_class,
          qbbo::Current_trading_state,
          qbbo::Market_category, qbbo::Reg_sho_action);
    ~Stock();
    void setFinancialStatusIndicator(qbbo::Financial_status_indicator financialStatusIndicator);
    void setSecurityClass(qbbo::Security_class securityClass);
    void setCurrentTradingState(qbbo::Current_trading_state tradingState);
    void setMarketCategory(qbbo::Market_category marketCategory);
    void setREGShoAction(qbbo::Reg_sho_action regSHOAction);
    bool isStockTrading();

  private:
    enum StockState {
      STOCK_STATE_OK, STOCK_STATE_UNKNOWN, STOCK_STATE_UNEXPECTED_CHARACTERISTIC
    };

    std::string name;
    int inventory;
    StockState currentState;

    // Expected values initialised in constructor
    qbbo::Financial_status_indicator expectedFinancialStatusIndicator;
    qbbo::Security_class expectedSecurityClass;
    qbbo::Current_trading_state expectedCurrentTradingState;
    qbbo::Market_category expectedMarketCategory;
    qbbo::Reg_sho_action expectedRegSHOAction;

    // Actual values as set by messages
    qbbo::Financial_status_indicator financialStatusIndicator;
    qbbo::Security_class securityClass;
    qbbo::Current_trading_state currentTradingState;
    qbbo::Market_category marketCategory;
    qbbo::Reg_sho_action regSHOAction;

    void nextState();
};

I cannot see whats invalid about this declaration and it compiles fine. Is there something I’m missing and Eclipse is catching?

Short Self Contained Correct Example

#include <string>
#include <map>

#include "stock.h"

int main() {
  std::map<std::string, Stock*> stocks;
}
  • 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-06T09:55:54+00:00Added an answer on June 6, 2026 at 9:55 am

    Turned out to be an eclipse error. Creating a new project and re-following the steps Eclipse CDT C++11/C++0x support sorted it.

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

Sidebar

Related Questions

I would like to have declaration like this: void Date::get_days_name(const Date& = this) which
I have a simple SFINAE scenario to distinuish standard containers like std::map : template
I have a declaration in a cpp where a function is like: virtual void
I have a C code in which I have a structure declaration which has
Other languages with automatic variable declaration - like Perl - have a strict mode.
I have successfully constructed something similar to the following code in visual studio 2008:
In Struts 1 you could have, in struts-config.xml, a declaration like: <action path=/first forward=/second.do>
Can't I have an anonymous delegate declaration, something similar to the following: ThreadStart starter
I know similar questions have been asked before, but still things are not clear
Does anyone have an example (code or a link) that will allow me 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.