Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2002-09-22 10:29:04


the current implementation of bound_objects_visitor contains a bug. It fails
to correctly handle bound objects that are based on ptrs to function.


void foo(int);
bind(&foo, _1);

from trackable.hpp L.89ff

      template<typename T>
      void decode(const T& t, long) const
        typedef truth<(is_pointer<T>::value)> is_a_pointer;
        maybe_get_pointer(t, is_a_pointer());

      // maybe_get_pointer() decides between a pointer and a non-pointer
      template<typename T>
      void maybe_get_pointer(const T& t, truth<true>) const


      inline void add_if_trackable(const void*) const

What happens is that is_pointer<T> evaluates to true for function ptrs.
maybe_get_pointer in turn calls add_if_trackable with a function pointer
argument. This triggers an no such instance of overloaded function accepts
argument list error as function ptrs are not convertible to void*.

So far I can't come up with an easy and portable fix.


Dipl.-Ing. Thomas Witt
Institut fuer Verkehrswesen, Eisenbahnbau und -betrieb, Universitaet Hannover
voice: +49(0) 511 762 - 4273, fax: +49(0) 511 762-3001

Boost list run by bdawes at, gregod at, cpdaniel at, john at