signal type declaration problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

signal type declaration problem

Emre Birol
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 mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users