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 : 错误 C2039: 'BROKER' : 不是 broker_def::brokerDisTradable 的成员'
任何想法?
谢谢!