Skip to content

Commit d7b3732

Browse files
committed
fixed unwanted conversion in Resource
1 parent f6336c7 commit d7b3732

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/resource/include/ut/resource/resource.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef UT_RESOURCE_HPP
22
#define UT_RESOURCE_HPP
33

4+
#include <concepts>
45
#if __cplusplus < 202'002L
56
# error this file has to be compiled with at least C++20
67
#endif
@@ -140,6 +141,12 @@ class Resource {
140141
return hasValue();
141142
}
142143

144+
/**
145+
* If this is not deleted, it allows for a Resource -> bool -> int conversion
146+
*/
147+
template<std::integral Int>
148+
operator Int() const = delete;
149+
143150
/**
144151
* Acquire the resource.
145152
*

0 commit comments

Comments
 (0)