Subject: CGAL users discussion list
List archive
- From: "Laurent Rineau (CGAL/GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Kd_tree move constructible
- Date: Thu, 26 Nov 2015 18:58:52 +0100
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:K4P4NBNSqH6sIVws4vcl6mtUPXoX/o7sNwtQ0KIMzox0KPv5rarrMEGX3/hxlliBBdydsKIZzbqO+Pm4ACQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTqkbDqsMSLOk1hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv50IbaKvdKsxSflUDS8tLnsuzMztrxjKCwWVtVUGVWBD2D5BHhLI6g2yZJb3vyLn/qpW9wC+euL7SrU5RS6zwa5gVBjymWZNf2o9+XzNh8psyrhaph+oujR0zIfQJoaPO6wtLevmYdoGSD8ZDY5qXCtbD9bkYg==
- Organization: GeometryFactory
Le Wednesday 25 November 2015 18:52:03 Marc Glisse a écrit :
> 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.
But should not the CGAL develop try to allow the move constructor, when the
copy constructor is disabled?
--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/
- [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.