well, that .begin() call was a typo, so sorry about that. If I was to use a vector then the call would look something like ((a_test).*(a_test.p[0]))();
But that's not my concer. I want to know how to use set and insert(). You can comment out ((a_test).*(a_test.begin()))();. Right now I want to know how to get p.insert( &test::g ); working.
This is the kind of errors that I'm getting:
Code:
-*- mode: compilation; default-directory: "~/Programming/CPP/" -*-
Compilation started at Sun Dec 7 21:35:52
g++ -o t03 t03.cpp
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4/bits/stl_function.h: In member function 'bool std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = int (test::*)()]':
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4/bits/stl_tree.h:921: instantiated from 'std::pair<typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator, bool> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::insert_unique(const _Val&) [with _Key = int (test::*)(), _Val = int (test::*)(), _KeyOfValue = std::_Identity<int (test::*)()>, _Compare = std::less<int (test::*)()>, _Alloc = std::allocator<int (test::*)()>]'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4/bits/stl_set.h:321: instantiated from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, typename _Alloc::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const _Key&) [with _Key = int (test::*)(), _Compare = std::less<int (test::*)()>, _Alloc = std::allocator<int (test::*)()>]'
t03.cpp:9: instantiated from here
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4/bits/stl_function.h:227: error: invalid operands of types 'int (test::* const)()' and 'int (test::* const)()' to binary 'operator<'
Compilation exited abnormally with code 1 at Sun Dec 7 21:35:52