【发布时间】:2011-02-16 11:54:02
【问题描述】:
template<class T>
struct broker
{
typedef T typeBroker;
static std::vector<std::string> extractListBroker(const std::string& broker)
{
std::vector<std::string> vec;
if(broker.empty())
{
for(int i=0;i<typeBroker::nbBroker;++i)
vec.push_back( typeBroker::listBroker[i] );
}
else
{
typedef boost::tokenizer<boost::char_separator<char> > my_tok;
boost::char_separator<char> sep( ";" );
my_tok tok( broker, sep );
for ( my_tok::const_iterator i = tok.begin(); i != tok.end(); ++i )
vec.push_back( *i );
}
return vec;
}
std::string brokerToStr(typename typeBroker::BROKER i) //<--Problem here !!
{
return typeBroker::listBroker[i];
}
};
struct brokerDisTradable : broker<brokerDisTradable>{
std::vector<std::string> listBroker;
brokerDisTradable()
{
listBroker.push_back("BRIDGE1" );
listBroker.push_back("BRIDGELONDON" );
listBroker.push_back("RECY" );
listBroker.push_back("CURRENEX" );
}
static const int nbBroker = 2;
enum BROKER { BRIDGE1, BRIDGELONDON, RECY, CURRENEX };
};
errro : error C2039: 'BROKER' : is not a member of broker_def::brokerDisTradable'
有什么想法吗?
谢谢!
【问题讨论】:
-
提示:如果您希望人们了解您认为您的代码在做什么,请不要在粘贴的代码中保留非英语 cmets。
-
broker_def 是一个命名空间抱歉