* Added template argument deduction for not_null
This allows compilers with c++17 support to infer template
instantiation types when calling not_null constructor:
int foo(not_null<const int*> x);
int main()
{
int t = 0;
not_null x{ &t };
return foo(not_null{ &t });
}
* replaced deduction guides by a simple constructor
* Updated tests
* fixed check for availability of std::byte
* testing c++1z on clang
* fixed cmakelists extra endif
* include cstddef header for clang and gcc in pointers
* fixed a typo
* fix missing nullptr_t type
* fixed typo in CMakeLists.tst
* change approach to c++17 testing, step one: revert cmake testing, update clang5.0 package
removed using latest c++ due to clang5.0 failing,
update clang5.0 travis config to use llvm-toolchain-trusty-5.0
* addressed comments
* Fixes issue with dereferencing operator issue #491 introduced in PR #513
dereferencing operator added in PR#513 returned a copy of the object
instead of reference to it.
Adding decltype(auto) as return type of operator* fixes this issue.
* added more tests for not_null::operator*
Project files were not following the clang-format style. For people
using IDEs were clang-format is always run after a save this would
cause unwanted changes.
This commit only applies "clang-format -i" to files.
* Added support of not_null<smart_ptr> comparison
* The return type of not_null comparison operators is determined using SFINAE
#474
* tests for gsl::not_null comparison were added
* not_null comparison tests were rewritten to compare pointers to objects located in the same array
* not_null<shared_ptr> comparison was simplified
When turning on the following flags, several additional warnings
were generated, which have been cleaned up in this patch. The
flags included:
-Wextra
-Wpedantic
-Wconversion
-Wsign-conversion
-Wctor-dtor-privacy
-Wshadow
-Wnon-virtual-dtor
-Wold-style-cast
-Wcast-align
-Woverloaded-virtual
whether using it from the development folder, from the installation
folder or from being copied into a project.
#include <gsl/gsl.h>
Updated headers/tests/instructions/cmake build accordingly
This PR should address https://github.com/Microsoft/GSL/issues/277 (less
the renaming of gsl itself)
Also removed unused constant member variable that seemed to be there
to prevent maybe_null_* being used with anything other than a pointer,
which is being taken care of with a static_assert now.