geom: delete rval constructors for samplers

Samplers tend to hold a const reference to the relevant data and so we
want to ensure it's not possible to inadvertantly pass in a reference to
data that is going out of scope.
This commit is contained in:
Danny Robson 2018-11-28 15:23:03 +11:00
parent 1e0a87d5df
commit 532bd3b706
3 changed files with 7 additions and 1 deletions

View File

@ -148,6 +148,7 @@ namespace cruft::geom::sample {
public:
using shape_type = aabb<S,T>;
volume (shape_type&&);
volume (shape_type const &target):
m_target (target)
{ ; }

View File

@ -152,6 +152,7 @@ namespace cruft::geom::sample {
public:
using shape_type = ellipse<2,T>;
volume (shape_type &&) = delete;
volume (shape_type const &target):
m_target (target)
{ ; }

View File

@ -49,7 +49,10 @@ namespace cruft::geom::sample {
template <typename ShapeT>
class volume {
public:
explicit volume (ShapeT const &target):
using shape_type = ShapeT;
explicit volume (shape_type&&) = delete;
explicit volume (shape_type const &target):
m_target (target)
{ ; }
@ -82,6 +85,7 @@ namespace cruft::geom::sample {
public:
using shape_type = extent<S,T>;
explicit volume (shape_type&&) = delete;
explicit volume (shape_type const &target):
m_target (target)
{ ; }