Thank John! I tried this, and it's ok:
struct Grepper
{
int nPriority;
boost::regex re;
friend bool operator< (const Grepper& g1, const Grepper& g2)
{
return g1.nPriority > g2.nPriority;
}
};
bool QueryGreppers(Grepper& gp)
{
gp.nPriority = 1;
gp.re =
boost::regex("\\s*#define\\s+([^\\s]+)\\s+([^/\\r\\n]+)([^\\r\\n]*)");
return true;
}
int main(void)
{
Grepper gp;
QueryGreppers(gp);
return 0;
}
But in my real project env, this code snippet is place into a DLL:
Grepper gp;
QueryGreppers(gp);
And QueryGreppers is a function pointer get from another dll, any
comments about this?
Another questions:
I only used Vc6 as develop tools, I know little about lib and dll
selection issue. Where can I learn about how to select boost lib and
dlls?
"John Maddock"
int main(void) { boost::regex re; re ="\\s*#define\\s+([^\\s]+)\\s+([^/\\r\\n]+)([^\\r\\n]*)"; return 0; }