diff --git a/thrust/device_new_allocator.h b/thrust/device_new_allocator.h index 645be1c02..c9c6b0e95 100644 --- a/thrust/device_new_allocator.h +++ b/thrust/device_new_allocator.h @@ -25,7 +25,10 @@ #include #include #include -#include + +#include +#include + #include THRUST_NAMESPACE_BEGIN @@ -61,8 +64,8 @@ template /*! \c const reference to allocated element, \c device_reference. */ typedef device_reference const_reference; - /*! Type of allocation size, \c std::size_t. */ - typedef std::size_t size_type; + /*! Type of allocation size, \c ::cuda::std::size_t. */ + typedef ::cuda::std::size_t size_type; /*! Type of allocation difference, \c pointer::difference_type. */ typedef typename pointer::difference_type difference_type; @@ -147,7 +150,7 @@ template __host__ __device__ inline size_type max_size() const { - return std::numeric_limits::max THRUST_PREVENT_MACRO_SUBSTITUTION () / sizeof(T); + return ::cuda::std::numeric_limits::max THRUST_PREVENT_MACRO_SUBSTITUTION () / sizeof(T); } // end max_size() /*! Compares against another \p device_malloc_allocator for equality. diff --git a/thrust/optional.h b/thrust/optional.h index 52008e4f6..5850b6ea0 100644 --- a/thrust/optional.h +++ b/thrust/optional.h @@ -1580,7 +1580,7 @@ class optional : private detail::optional_move_assign_base, *this = nullopt; this->construct(std::forward(args)...); - return value(); + return this->m_value; } /// \group emplace @@ -1594,7 +1594,7 @@ class optional : private detail::optional_move_assign_base, emplace(std::initializer_list il, Args &&... args) { *this = nullopt; this->construct(il, std::forward(args)...); - return value(); + return this->m_value; } /// Swaps this optional with the other.