STL compare function in a struct
May 7, 2011 at 1:58pm
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
bool comp(int a, int b) {
return true;
}
bool(*fn_pt)(int,int)=comp;
set<int,bool(*)(int,int)> test_point(fn_pt);
struct strTest {
set<int,bool(*)(int,int)> end_point(fn_pt);
};
int main() {
return 0;
}
|
why does the compiler complain about
set<int,bool(*)(int,int)> end_point(fn_pt);
in the struct? saying fn_pt is not a type.
May 7, 2011 at 5:07pm
because what you wrote there is a member function declaration.
Topic archived. No new replies allowed.