|
|
@@ -24,7 +24,7 @@ class resource {
|
|
|
friend class resource;
|
|
|
|
|
|
template<typename Other>
|
|
|
- static constexpr bool is_acceptable_v = !std::is_same_v<Type, Other> && std::is_constructible_v<Type &, Other &>;
|
|
|
+ static constexpr bool is_acceptable = !std::is_same_v<Type, Other> && std::is_constructible_v<Type &, Other &>;
|
|
|
|
|
|
public:
|
|
|
/*! @brief Resource type. */
|
|
|
@@ -64,7 +64,7 @@ public:
|
|
|
* @tparam Other Type of resource managed by the received handle.
|
|
|
* @param other The handle to copy from.
|
|
|
*/
|
|
|
- template<typename Other, typename = std::enable_if_t<is_acceptable_v<Other>>>
|
|
|
+ template<typename Other, typename = std::enable_if_t<is_acceptable<Other>>>
|
|
|
resource(const resource<Other> &other) noexcept
|
|
|
: value{other.value} {}
|
|
|
|
|
|
@@ -73,7 +73,7 @@ public:
|
|
|
* @tparam Other Type of resource managed by the received handle.
|
|
|
* @param other The handle to move from.
|
|
|
*/
|
|
|
- template<typename Other, typename = std::enable_if_t<is_acceptable_v<Other>>>
|
|
|
+ template<typename Other, typename = std::enable_if_t<is_acceptable<Other>>>
|
|
|
resource(resource<Other> &&other) noexcept
|
|
|
: value{std::move(other.value)} {}
|
|
|
|
|
|
@@ -98,7 +98,7 @@ public:
|
|
|
* @param other The handle to copy from.
|
|
|
* @return This resource handle.
|
|
|
*/
|
|
|
- template<typename Other, typename = std::enable_if_t<is_acceptable_v<Other>>>
|
|
|
+ template<typename Other, typename = std::enable_if_t<is_acceptable<Other>>>
|
|
|
resource &operator=(const resource<Other> &other) noexcept {
|
|
|
value = other.value;
|
|
|
return *this;
|
|
|
@@ -110,7 +110,7 @@ public:
|
|
|
* @param other The handle to move from.
|
|
|
* @return This resource handle.
|
|
|
*/
|
|
|
- template<typename Other, typename = std::enable_if_t<is_acceptable_v<Other>>>
|
|
|
+ template<typename Other, typename = std::enable_if_t<is_acceptable<Other>>>
|
|
|
resource &operator=(resource<Other> &&other) noexcept {
|
|
|
value = std::move(other.value);
|
|
|
return *this;
|