[program_options, function] vc7 problem
 
            The regression logs show this error message from vc7 http://tinyurl.com/39fgc which says that pointer to function can be converted to boost::function The relevant code is: int stored_value; void notifier(const vector<int>& v) { stored_value = v.front(); } void test_semantic_values() { .... ("int", po::value< vector<int> >()->notifier(notifier)) ; } Where the 'notifier' member function is defines as: typed_value* notifier(function1<void, const T&> f) and in this case, T = vector<int>. Any ideas what I can do to make this work? - Volodya
 
            Vladimir Prus wrote:
The regression logs show this error message from vc7
which says that pointer to function can be converted to boost::function
The relevant code is:
int stored_value; void notifier(const vector<int>& v) { stored_value = v.front(); }
void test_semantic_values() { .... ("int", po::value< vector<int> >()->notifier(notifier)) ; }
Where the 'notifier' member function is defines as:
typed_value* notifier(function1<void, const T&> f)
and in this case, T = vector<int>.
Any ideas what I can do to make this work?
IIRC boost::function requires the & in front of 'notifier'.
 
            On Friday 25 June 2004 7:14 am, Peter Dimov wrote:
void notifier(const vector<int>& v) { stored_value = v.front(); }
void test_semantic_values() { .... ("int", po::value< vector<int> >()->notifier(notifier)) ; }
Where the 'notifier' member function is defines as:
typed_value* notifier(function1<void, const T&> f)
and in this case, T = vector<int>.
Any ideas what I can do to make this work?
IIRC boost::function requires the & in front of 'notifier'.
Yep. This was a side effect (on VC 6/7 only) of working around some bugs in VC 6/7. Doug
 
            Doug Gregor wrote:
On Friday 25 June 2004 7:14 am, Peter Dimov wrote:
void notifier(const vector<int>& v) { stored_value = v.front(); }
void test_semantic_values() { .... ("int", po::value< vector<int> >()->notifier(notifier)) ; }
Where the 'notifier' member function is defines as:
typed_value* notifier(function1<void, const T&> f)
and in this case, T = vector<int>.
Any ideas what I can do to make this work?
IIRC boost::function requires the & in front of 'notifier'.
Yep. This was a side effect (on VC 6/7 only) of working around some bugs in VC 6/7.
I've added & in the test and will take a look at regression results on Monday. Thanks, Volodya
participants (3)
- 
                 Doug Gregor Doug Gregor
- 
                 Peter Dimov Peter Dimov
- 
                 Vladimir Prus Vladimir Prus