aboutsummaryrefslogtreecommitdiff
path: root/include/gsl/pointers
diff options
context:
space:
mode:
Diffstat (limited to 'include/gsl/pointers')
-rw-r--r--include/gsl/pointers10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/gsl/pointers b/include/gsl/pointers
index 7373826..7afed1c 100644
--- a/include/gsl/pointers
+++ b/include/gsl/pointers
@@ -100,7 +100,7 @@ public:
constexpr operator T() const { return get(); }
constexpr T operator->() const { return get(); }
- constexpr decltype(auto) operator*() const { return *get(); }
+ constexpr decltype(auto) operator*() const { return *get(); }
// prevents compilation when someone attempts to assign a null pointer constant
not_null(std::nullptr_t) = delete;
@@ -272,6 +272,14 @@ auto make_strict_not_null(T&& t) {
return strict_not_null<std::remove_cv_t<std::remove_reference_t<T>>>{std::forward<T>(t)};
}
+#if ( defined(__cpp_deduction_guides) && (__cpp_deduction_guides >= 201611L) )
+
+// deduction guides to prevent the ctad-maybe-unsupported warning
+template <class T> not_null(T) -> not_null<T>;
+template <class T> strict_not_null(T) -> strict_not_null<T>;
+
+#endif // ( defined(__cpp_deduction_guides) && (__cpp_deduction_guides >= 201611L) )
+
} // namespace gsl
namespace std