Subject: CGAL users discussion list
List archive
- From: Marc Glisse <>
- To:
- Subject: Re: [cgal-discuss] Kd_tree move constructible
- Date: Wed, 25 Nov 2015 18:52:03 +0100 (CET)
On Wed, 25 Nov 2015, Bart Vermeulen wrote:
I'm trying to use c++11 threads with a Kd_tree.
I have a function which takes a Kd_Tree as input:
void foo (Tree const & tree, ...) {
// Do something
}
Than I try to pass the function to a std::thread construction:
std::thread thethread(foo, tree, ...);
This gives me an error telling me that the constructor Kd_tree(const Tree& tree) is private.
The std::thread construction requires all parameters to be move constructible, but why is this construction private for a Kd_tree?
Is there some way around this issue?
http://en.cppreference.com/w/cpp/utility/functional/reference_wrapper
On Wed, 25 Nov 2015, Bart Vermeulen wrote:
I solved the issue passing a pointer to the tree, instead of a reference.
Still I think it's strange that the copy construction is made private in Kd_tree.
How often do you actually want a copy of a kd-tree? If you are doing the copy by accident, or because you don't know the right syntax, it is good that you get some error about it.
--
Marc Glisse
- [cgal-discuss] Kd_tree move constructible, Bart Vermeulen, 11/25/2015
- Re: [cgal-discuss] Kd_tree move constructible, Bart Vermeulen, 11/25/2015
- Re: [cgal-discuss] Kd_tree move constructible, Marc Glisse, 11/25/2015
- Re: [cgal-discuss] Kd_tree move constructible, Laurent Rineau (CGAL/GeometryFactory), 11/26/2015
- Re: [cgal-discuss] Kd_tree move constructible, Marc Glisse, 11/26/2015
- Re: [cgal-discuss] Kd_tree move constructible, Laurent Rineau (CGAL/GeometryFactory), 11/26/2015
- Re: [cgal-discuss] Kd_tree move constructible, Marc Glisse, 11/25/2015
- Re: [cgal-discuss] Kd_tree move constructible, Bart Vermeulen, 11/25/2015
Archive powered by MHonArc 2.6.18.