Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not_null and maybe_null_* should have explicit conversion operators. #83

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/gsl.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class not_null
return ptr_;
} // the assume() should help the optimizer

operator T() const { return get(); }
explicit operator T() const { return get(); }
T operator->() const { return get(); }

bool operator==(const T& rhs) const { return ptr_ == rhs; }
Expand Down Expand Up @@ -258,7 +258,7 @@ class maybe_null_dbg
return ptr_;
}

operator T() const { return get(); }
explicit operator T() const { return get(); }
T operator->() const { return get(); }

private:
Expand Down Expand Up @@ -328,7 +328,7 @@ class maybe_null_ret

T get() const { return ptr_; }

operator T() const { return get(); }
explicit operator T() const { return get(); }
T operator->() const { return get(); }

private:
Expand Down