|
Boost Users : |
Subject: [Boost-users] Anyone see anything like this??
From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2009-10-15 17:20:26
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.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net