Dev/annagrin/make not null (#711)

* Added c++17 test configurations for clang5.0 and clang6.0

* Added make_not_null helper to create a not_null

Introduction of explicit not_null constructor made it cumbersome to create not_nulls
in c++14. Adding make_not_null helper. Usage (see tests):

int i = 42;

auto x = make_not_null(&i);
helper(make_not_null(&i));
helper_const(make_not_null(&i));

* Added std::forward to make_not_null, fixed some code analysis warnings

* Fix build break in VS2015 Release configuration

* Fix build break in VS2015 Release configuration
This commit is contained in:
Anna Gringauze authored and GitHub committed 2018-08-13 02:22:02 -07:00
1 parent f1a2e91e4e
commit 831584d947
2 files changed
+66

No files matched your search

+5
View File
@@ -119,6 +119,11 @@ private:
T ptr_;
};
template <class T>
auto make_not_null(T&& t) {
return gsl::not_null<std::remove_cv_t<std::remove_reference_t<T>>>{std::forward<T>(t)};
}
template <class T>
std::ostream& operator<<(std::ostream& os, const not_null<T>& val)
{