[sigc] libsigc++ 2 v. g++ 3.4



I'm trying to build libsigc++ with a cvs checkout of gcc 3.4 (from the
gcc-3_4-branch). I'm getting a strange compile error:

In file included from ../sigc++/adaptors/adaptor_trait.h:8, 
from ../sigc++/functors/slot.h:7, 
from ../sigc++/signal_base.h:27, 
from ../sigc++/signal.h:8, 
from signal.cc:20: 
../sigc++/functors/mem_fun.h: In member function `T_return
sigc::bound_mem_functor0<T_return, T_obj>::operator()() const': 
../sigc++/functors/mem_fun.h:1781: error: `z' undeclared (first use this
function) 
../sigc++/functors/mem_fun.h:1781: error: (Each undeclared identifier is
reported only once for each function it appears in.) 
../sigc++/functors/mem_fun.h:1781: error: expected `;' before "return" 
../sigc++/functors/mem_fun.h: In member function `T_return
sigc::bound_mem_functor1<T_return, T_obj, T_arg1>::operator()(typename
sigc::type_trait<T_arg3>::take) const': 
../sigc++/functors/mem_fun.h:1838: error: `func_ptr_' undeclared (first
use this function) 


That looks like a gcc bug. But I don't actually understand the code that
fails:

T_return operator()(typename type_trait<T_arg1>::take _A_a1) const
{  return (obj_ptr_->*func_ptr_)(_A_a1); }


I don't know what that ->* is meant to do? Which dereference happens
first?

This code compiles, but I don't know if it is actually equivalent:

T_return operator()(typename type_trait<T_arg1>::take _A_a1) const
{
  function_type the_func = obj_ptr_->func_ptr;

  return (*the_func)(_A_a1);
}

-- 
Murray Cumming
www.murrayc.com
murrayc murrayc com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]