asherliu / thrust

Automatically exported from code.google.com/p/thrust
Apache License 2.0
0 stars 0 forks source link

device_ptr construction from and convertibility to related types need to be protected by enable_if #309

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Certain type traits like is_convertible don't work correctly otherwise.

Original issue reported on code.google.com by jaredhoberock on 15 Feb 2011 at 10:05

GoogleCodeExporter commented 8 years ago
It seems like conversion from device_ptr<T> to device_ptr<U> is allowed right 
now, without any sort of cast.  This is dangerous and shouldn't be possible.

We should remove device_ptr's conversion operator (which cannot be protected by 
enable_if_convertible) in favor of a single constructor from device_ptr<U>, 
which can be protected.  We should get the same syntax minus the current unsafe 
behavior.  This could break user code, though.

Original comment by jaredhoberock on 15 Feb 2011 at 10:31

GoogleCodeExporter commented 8 years ago
This issue was closed by revision b9d25ecd34d3.

Original comment by jaredhoberock on 5 Aug 2011 at 9:21