This commit updates the CMake files to use newer CMake features.
GSL is now a INTERFACE and one only need to link against that interface
(include paths and natvis files will be taken care automatically).
Whene generating a VS project test will be properly nested into a test
subfolder.
if(compiler) expression were modified to generator expressions.
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.
* Add value_type to span
Currently I'm working on project which involves a lot of `span`s and mocking via Google Mock. Unfortunately a lot of standard matchers requires `value_type` type definition inside container which `gsl::span` lacks.
This pull request add `value_type` type definition inside `gsl::span`
* Strip cv from value_type of span and span_iterator
* 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
* initializer_list overload returns by value to avoid lifetime issues
* generic overload uses expression SFINAE to work with any type that has member size() and operator[], which notably includes const/non-const vector and array.
* Add test coverage for const objects, rvalue initializer_lists, and constexpr usage.
Fixes#357.
* Improve const correctness in string_span
* Improve const correctness in bounds_tests.cpp and byte_tests.cpp
* Improve const correctness in span_tests.cpp
* Improve const correctness in utils_tests.cpp
* Use gsl::owner for dynamically allocated memory in string_span_tests.cpp
* Improve const correctness in string_span_tests.cpp
* Improve const correctness for strided_span_tests.cpp
* CI updates:
Travis: use cmake 3.7
Appveyor: Add .appveyor.yml config, test VS2013/VS2015/VS2017 x86/x64 Debug/Release.
* Drop VS2013 support from AppVeyor.
* GSL_LIKELY/_UNLIKELY always contextually convert their argument to bool.
* Add macro GSL_ASSUME(cond) to inform the optimizer that the predicate cond must hold.
* Reimplement Expects & Ensures as expressions for flexibility and correctness. (Think about "if (cond1) Expects(cond2); else goto fail;")
* Expects and Ensures GSL_ASSUME their predicate when GSL_UNENFORCED_ON_CONTRACT_VIOLATION is defined.
* add gsl::not_null operator<<
Hippomocks, which is a popular mocking engine for C++ uses operator<< on pointers and gets confused about gsl::not_null not having this operator.
* Update gsl
* Update README.md
edited link to the `gsl` include directory
* Update README.md
added `include` to the include path according to the directory structure
* 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.
Now that the STL respects /W4, this test that uses std::copy_n to copy a span of ints to a span of chars triggers "warning C4244: '=': conversion from 'int' to 'char', possible loss of data". Switch the source & destination spans to short and int to maintain the test's cross-type nature but without narrowing.
* Nest "gsl" directory inside a new "include" directory.
* Cleanup the _MSC_VER conditionals a bit; use constexpr on VS2017+.
* Don't #define noexcept on non-Microsoft implementations.
* Workaround VS2017 bug in multi_span. (Also implement == and != for static_bounds_dynamic_range_t because I'm an EoP semantic soundness snob.)
Fixes#441.
This patch provides a make_span function to simplify the
creation of spans until C++17 is available. In addition
this patch updates the unit tests to includes tests that
verify this new functionality.
This patch adds support for std::unique_ptr and
std::shared_ptr to the gsl::span
class instead of having to manually grab the pointer via
get().
For reference, this is part of the following issue:
https://github.com/Microsoft/GSL/issues/402
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
This patch fixes an overflow that was identified with
strict overflow warnings enabled, and optimizations
turned on
Signed-off-by: “Rian <“rianquinn@gmail.com”>
'make install' should install the GSL library (ie. the headers),
not the tests.
It still installs the UnitTest++ headers, but that will be more
complex to fix, as GSL just imports UnitTest++ as a git submodule,
and the install command propagates down to UnitTest++'s
CMakeLists.txt.
* Add test to demonstrate byte aliasing problem on g++ and clang++
* Add note about no-strict-aliasing flag in README
* Activate aliasing unit test and use -fno-strict-aliasing flag