Commit Graph

106 Commits

Author SHA1 Message Date
Daniel599
5778149583 Test broken size (#704)
* added test for size check (#590)

* added #if for gcc 6.4 bug (#590)

* hopefully fix #if for gcc 6.4 bug (#590)

* fixed CHECK usage (#590)

* gcc broken size bug is only when using optimizations
2018-07-13 17:19:09 -07:00
Neil MacIntosh
6a33b97a84
Fix return type of templated span.subspan() (#625)
* Added support for returning fixed-spize spans from subspan().

* Addressed issues from code review.

* Took simpler approach to static data member.

* Subtle fix to support MSVC 15.

* Helps to not introduce extraneous >
2018-03-03 19:12:45 -08:00
Neil MacIntosh
2bdbba7418 Removed span from-nullptr_t ctor. 2018-02-10 19:21:22 -08:00
Neil MacIntosh
72688ff009 Removed span.length() as synonym for span.size(). 2018-02-10 18:58:28 -08:00
Neil MacIntosh
028925caba Removed from-smart-ptr constructors. 2018-02-10 18:05:17 -08:00
Tiago
0d33bf6794 Applied iwyu --comment to the code base (#588) 2017-11-28 07:13:49 -08:00
menete
1d936eb90c additional span tests (pointer length constructor) (#568) 2017-10-31 10:11:45 -07:00
Neil MacIntosh
b2ee484334 Move from unittest-cpp to catch for unit testing. (#533)
Many thanks to @rianquinn. This should fix #495, #494 and #529.
2017-07-13 13:53:56 -07:00
Tiago
ebe7ebfd85 Reformat files to follow clang-format style (#492)
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.
2017-04-20 07:51:37 -07:00
MikeGitb
ade86caa92 Fix some corechecker warnings (#470)
* 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
2017-04-02 12:30:49 -07:00
Casey Carter
96eaf274f8 Make is_default_constructible work for spans. 2017-01-28 00:08:48 -08:00
Rian Quinn
2df9f85385 Add make_span()
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.
2016-11-16 10:17:04 -08:00
Rian Quinn
bdcef948a5 Cleanup compiler warnings
The unique_ptr / shared_ptr patch introduced a compiler
warning. This corrects that issue.
2016-11-16 09:42:46 -08:00
Rian Quinn
2b51b8767a Add span construction from unique_ptr and shared_ptr
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
2016-11-03 18:55:41 -07:00
Rian Quinn
d641796b21 Cleanup additional GCC warnings
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
2016-11-03 18:38:32 -07:00
Rian Quinn
6cffe0d14c Adds gsl::span::at()
As per this discussion:
https://github.com/Microsoft/GSL/issues/402

This patch adds support for at() to gsl::span
2016-10-26 14:11:24 -07:00
Neil MacIntosh
3b2419532e Corrected SFINAE for conversion constructors on span. 2016-09-12 18:51:23 -07:00
ericLemanissier
134f2db5d9 Specialize gsl::at for span
span being a view and not a container, the generic version of gsl::at is not valid any more for span.
This commits adds a specialization of gsl::at for span
2016-08-23 12:18:36 +02:00
Neil MacIntosh
f3e660a5a5 Added basic test for interop with std::regex as per Issue #271. 2016-08-10 19:39:48 -07:00
Neil MacIntosh
d6ac640271 Added basic test for interop with std::regex as per Issue #271. 2016-08-10 19:32:00 -07:00
Neil MacIntosh
6b4ae834a3 Merge branch 'master' into dev/neilmac/iterators 2016-08-10 19:00:43 -07:00
Galik
222c2d85fd Removed .h extension from header files. 2016-08-10 17:24:00 +01:00
galik
f6cc5798a1 Renamed include/ folder to gsl/ to make including the library consistent
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)
2016-08-09 15:04:58 +01:00
Neil MacIntosh
32ee66d320 Added basic tests for std::begin/end and friends (Issue #252). 2016-08-08 13:48:12 -07:00
Neil MacIntosh
0dd5f56bed Fixed unused variable and ran clang-format. Tested on gcc/clang. 2016-08-08 13:33:02 -07:00
Neil MacIntosh
82389aa630 Fixed up iterator implementation to allow conversion from iterator to
const_iterator.
2016-08-08 12:06:47 -07:00
Neil MacIntosh
8e31f53f8a Building clean with MSVC12. 2016-07-29 11:16:06 -07:00
Neil MacIntosh
ca4cdd80de 64-bit clean fixes. 2016-07-20 12:47:21 -07:00
Neil MacIntosh
30a038ca6a Added tests for span iterators, fixed implementation. 2016-07-18 11:38:01 -07:00
Neil MacIntosh
8855c59579 Added basic compile support for MSVC 2013 to byte. 2016-07-15 17:31:40 -07:00
Neil MacIntosh
62f30205e5 Additional std::array ctor to support const element cases. 2016-06-14 20:14:17 -07:00
Neil MacIntosh
c94a66f468 Tightened SFINAE for span<U> to span<T> conversions. 2016-06-12 18:28:19 -07:00
Neil MacIntosh
ba8ebef509 Added span to object rep conversions. 2016-05-29 17:06:29 -07:00
Neil MacIntosh
d63c9803da Added comparison operators. 2016-05-29 14:05:09 -07:00
Neil MacIntosh
d9d6ff0121 Added iterators. 2016-05-29 13:52:28 -07:00
Neil MacIntosh
85939048b4 Test for operator function call. 2016-03-18 16:53:16 -07:00
Neil MacIntosh
c8a412f028 Implemented first, last, subspan. 2016-03-18 16:49:29 -07:00
Neil MacIntosh
3d4c34966a Fixed ctors for Container and std::array to accept temporaries. 2016-03-17 17:20:33 -07:00
Neil MacIntosh
717a2e35f1 Added conversion ctors. 2016-03-16 19:39:55 -07:00
Neil MacIntosh
c40094a532 Added from-container constructors. 2016-03-01 12:11:41 -08:00
Neil MacIntosh
f61a9bba48 Added array constructors. 2016-02-29 13:16:48 -08:00
Neil MacIntosh
502cd6650a Checking in to continue working elsewhere. 2016-02-28 00:50:53 -08:00
Neil MacIntosh
cc22f2bf42 first/last constructor working. 2016-02-25 11:42:26 -08:00
Neil MacIntosh
d3929c59a0 Began reimplementation of span. Basic constructors. 2016-02-24 16:11:33 -08:00
Neil MacIntosh
cec26a23b9 Added new span-related files. 2016-02-24 11:26:28 -08:00
Neil MacIntosh
d2f12a8fa3 File renames to reflect new multi_span name. 2016-02-24 11:03:33 -08:00
Neil MacIntosh
49e80625c6 Renamed existing span to multi_span. 2016-02-24 10:29:29 -08:00
Neil MacIntosh
c9959b1071 Corrected some variable naming. 2015-11-30 05:34:38 +00:00
Neil MacIntosh
0cf947db77 Reworked span to match GSL design. 2015-11-29 19:19:37 -08:00
Elron A. Yellin
e4d8d35af5 add as_span overload for basic_string which doesn't have nonconst .data() like other contiguous containers 2015-11-20 17:50:02 -05:00
Anna Gringauze
c95eb57d3f Fixed conversion problem when creating strided_span from span and bounds 2015-11-19 13:13:15 -08:00
Anna Gringauze
f510025109 Removed basic_span class 2015-11-13 12:54:37 -08:00
Anna Gringauze
8aa4248722 Removing basic_span base class from span 2015-11-13 12:52:02 -08:00
Neil MacIntosh
fa056f67e8 Enabled -Wall for gcc and clang. 2015-11-13 03:27:53 +00:00
Neil MacIntosh
a998a9b33b Turned on Level 3 warnings for MSVC. 2015-11-12 18:57:23 -08:00
Neil MacIntosh
b63ec949e9 Renaming array_view and string_view, as per WG21 discussions. 2015-11-04 12:42:27 -08:00