Boost logo

Boost Users :

From: Emre Birol (ebirol_at_[hidden])
Date: 2006-04-06 14:23:29


Hi all,

I have a class like below and I want to declare a signal type inside my
class. Unfortunately when I do that MS VC80 complaints. Any help highly
will be appreciated.

     template <typename T>
     class MyTask
     {
     public:
         // type definitions
         typedef enum { waiting, running, completed, failed } States;
         typedef boost::signal<void (States)> StatusChanged;
         typedef boost::signals::connection Connection;
     };

I get two warnings first then an error:

Warning 1 warning C4512: 'boost::signals::detail::bound_objects_visitor'
: assignment operator could not be generated
c:\lib\boost\include\boost-1_33\boost\signals\trackable.hpp 185

Warning 2 warning C4346:
'boost::signal<void(lumentest::NITask<trait>::States)>::slot_function_type'
: dependent name is not a type
c:\projects\tesla-at-sti\src\lumentest\devices\nitask.hpp 124

Error 3 error C2061: syntax error : identifier 'slot_function_type'
c:\projects\tesla-at-sti\src\lumentest\devices\nitask.hpp 124

if I replace 'States' with an int type then it works. I think compiler
can't find out the type of States properly...

I've also tried following declarations. None of them worked.
    typedef boost::signal<void (MyTask::States)> StatusChanged;
    typedef boost::signal<void (MyTask<T>::States)> StatusChanged;
    typedef boost::signal<void (typename MyTask::States)> StatusChanged;

thanks,
Emre


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