Invalid template arguments on std :: map <std :: string, stocks *> and stocks

I have an ad (or similar)

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

in all my code. Eclipse does not like this and generates the "Invalid template parameters" error.

Shares are 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 canโ€™t understand what is invalid in this declaration, and it compiles fine. Is there something I'm missing and Eclipse catches?

Short self-preserving correct example

 #include <string> #include <map> #include "stock.h" int main() { std::map<std::string, Stock*> stocks; } 
+6
source share
1 answer

It turned out to be an eclipse error. Creating a new project and redoing the steps. Eclipse CDT C ++ 11 / C ++ 0x support sorted.

+2
source

Source: https://habr.com/ru/post/917435/


All Articles