|
Boost Users : |
Subject: Re: [Boost-users] [thread] Internal compiler error when trying to make movable future
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2013-09-08 18:51:14
On 7/09/2013 19:47, Quoth Vicente J. Botet Escriba:
> Le 06/09/13 04:54, Gavin Lambert a écrit :
>> Am I doing something wrong in the following code?
>>
>> #include <boost/thread/future.hpp>
>>
>> template<typename T>
>> struct test_node
>> {
>> BOOST_THREAD_MOVABLE_ONLY(test_node)
>>
>> typedef boost::unique_future<test_node> future_node;
>>
>> T value;
>> future_node next;
>> };
[...]
> please,could you post a complete example so that I can try to reproduce it.
The code above is pretty much a complete example. The only thing
further to do is to try to instantiate it (the error output I showed was
from trying to instantiate test_node<int>).
It's not necessary to interact with it beyond simple instantiation --
that seems to be enough to upset the compiler.
FWIW, I've worked around the issue for the moment by storing a
std::auto_ptr<future_node> as the "next" field value instead of using it
directly. I think that confirms my hypothesis that it's getting upset
at trying to evaluate metadata on an incomplete type.
(I'd use a std::unique_ptr instead if I were targetting C++11, of
course. I was kinda surprised I couldn't find a unique_ptr emulation in
boost, actually.)
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