
On 7/09/2013 19:47, Quoth Vicente J. Botet Escriba:
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; }; [...]
Le 06/09/13 04:54, Gavin Lambert a écrit : 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.)