-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
not_null cleanups and improvements: (#449)
* constexpr all the things. * remove operator=(const T&) * it leaves *this in an invalid state if ensure_invariant fails * implicitly converting the T to not_null and then assigning is in every way superior. * simplify conversion from not_null<U> with constructor delegation. * remove the converting assignment operator; again let the conversion constructor and self-assignment operator do the work. * Cover the remaining pointer arithmetic operations as Wakely suggests in issue #447. * Cleanup not_null conversions from null pointer constants: * replace constructor that accepts T with constructor template that accepts U convertible to T * remove deleted constructor that accepts int * Attempts to initialize with nullptr, 0, 0L, 0LL, etc. all unambiguously select the deleted nullptr_t constructor.
- Loading branch information
1 parent
6367b42
commit e3fecbd
Showing
1 changed file
with
33 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters