Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-10-08 11:13:44


--- In boost_at_y..., helmut.zeisel_at_a... wrote:
> I tried to compile
>
> http://www.boost.org/libs/thread/doc/thread.html#Example
>
> under VC++ 6.0 and had the following problems:
>
> 1) #include <boost/thread/xtime.hpp> is missing
>
> 2) For some reason, "thrd" is parsed as a function pointer,
> not as an object of class boost::thread.
>
> I found two workarounds for that problem:
>
> 2a) Make two lines of code instead of one:
>
> thread_alarm fct(secs);
> boost::thread thrd(fct);

Interesting. Any standards experts wich to comment on whether this
is a VC++ bug or a mistake in the example code? I can change the
code to use two lines in the documentation.

> 2b) Explicitely construct a function0 object:
>
> boost::thread thrd(boost::function0<void>(thread_alarm(secs)));
>
> 3) VC++ 6.0 gives a bothersome warning if no "return 0"
> is at the end of main.

Well, that's just a VC++ problem. The code is valid and shouldn't
produce a diagnostic, so I'm not going to change it.

Bill Kempf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk