Anyone see anything like this??

In mem_fn.hpp (not sure what is doing this but my bet is bind or function) there is a function dm<R,T>::call<U> that looks like so: template<class U> R const & call(U & u, void const *) const { return (get_pointer(u)->*f_); } The stupid compiler (MSVC++ 8.0) complained that u is an unreferenced formal parameter and then crashed. So I told it to stop giving me that warning in the file that is causing the issue and the problem went away...until I set about trying use the function that I just wrote that caused it. Now I get this: 1>d:\boostvs39\include\boost\bind\mem_fn.hpp(334) : error C4716: 'boost::_mfi::dm<void __thiscall(unsigned int),esi::units::unit_settings>::call<esi::pipeflo::document::unit_pool * const>' : must return a value I can't recreate this in a simple program. Here's the code of the function that I just wrote when this BS started happening: void on_change(wxGridEvent & event) { using namespace esi::units::systems::SI; using namespace esi::pipeflo::document; if (event.GetCol() == 0) return; std::pair< boost::function< std::vector< std::string >() > , boost::function< void(size_t) > > functions[] = { std::make_pair( boost::bind(&unit_settings::get_labels<pressure>, &units) , boost::bind(&unit_settings::set_selection <pressure>, &units) ) , std::make_pair( boost::bind(&unit_settings::get_labels<length>, &units) , boost::bind(&unit_settings::set_selection<length>, &units) ) , std::make_pair( boost::bind(&unit_settings::get_labels<mass_flow>, &units) , boost::bind(&unit_settings::set_selection <mass_flow>, &units) ) , std::make_pair( boost::bind(&unit_settings::get_labels <dynamic_viscosity>, &units) , boost::bind(&unit_settings::set_selection <dynamic_viscosity>, &units) ) , std::make_pair( boost::bind(&unit_settings::get_labels <mass_density>, &units) , boost::bind(&unit_settings::set_selection <mass_density>, &units) ) }; std::vector< std::string > labels = functions[event.GetRow()].first (); std::vector< std::string >::iterator fit = std::find(labels.begin(), labels.end(), grid->GetCellValue(event.GetRow(), event.GetCol())); assert(fit != labels.end() && "Somehow the user selected a unit that doesn't exist."); if (fit != labels.end()) { functions[event.GetRow()].second(std::distance(labels.begin(), fit)); } } The namespace esi::units::systems::SI has a "using boost::units::si" in it. I am not really expecting anyone can help me but I thought I'd try anyway. Surely other people have been stabbed in the face by this terribly buggy compiler.

Noah Roberts wrote:
In mem_fn.hpp (not sure what is doing this but my bet is bind or
It is bind.
function) there is a function dm<R,T>::call<U> that looks like so:
template<class U> R const & call(U & u, void const *) const { return (get_pointer(u)->*f_); }
...
1>d:\boostvs39\include\boost\bind\mem_fn.hpp(334) : error C4716: 'boost::_mfi::dm<void __thiscall(unsigned int),esi::units::unit_settings>::call<esi::pipeflo::document::unit_pool * const>' : must return a value
dm<> is the data member implementation, that is, what mem_fn returns when passed a pointer to a data member. You're binding a member function, in this case one with the signature void (unit_settings::*)(unsigned)...
std::make_pair( boost::bind(&unit_settings::get_labels<pressure>, &units) , boost::bind(&unit_settings::set_selection <pressure>, &units) )
... and the problem is that you haven't supplied the _1: boost::bind( &unit_settings::set_selection<pressure>, &units, _1 ) and the data member overload gets used instead because it happens to accept the argument list (&unit_settings::set_selection<pressure>, &units). Annoying, I know. But relatively rare. :-)

In article <A9D20A83D330405CBC32278C832DCB84@pdimov2>, pdimov@pdimov.com says...
You're binding a member function, in this case one with the signature void (unit_settings::*)(unsigned)...
Crap, I'm an idiot. When the compiler starts to crash on me I lose my cool I guess :P I should have seen this. Thanks.
participants (3)
-
Igor R
-
Noah Roberts
-
Peter Dimov