Commit Graph

963 Commits

Author SHA1 Message Date
Neil MacIntosh
3e5af6dc40 Fix compilation issues with Cygwin 2016-09-29 12:51:37 -07:00
Neil MacIntosh
e898a890e0 [multi_span] Fix UB hack in static_bounds::operator=(const static_bounds&) 2016-09-29 12:49:58 -07:00
Rian Quinn
9e055be659 Fix compilation issues with Cygwin
Cygwin recently did an update that broken string_span again. The original update had to provide a custom strnlen function because Cygwin doesn't implement this (it's a non-std extension). We never added wchar_t support, and the Cygwin update now breaks on exactly this. This patch provides the missing wchar_t.
2016-09-28 10:00:47 -06:00
Rian Quinn
3161d6133f Fix issue with VS builds
The Visual Studio part of this patch was wrong, and left an empty if statement.
2016-09-28 09:53:33 -06:00
Rian Quinn
4b29878d70 Add branch prediction to Ensures / Expects
We should be using branch prediction on asserts as these conditions are known to be unlikely, therefore we should be optimizing the likely case. These macros are similar to what the Linux kernel uses. Not really sure what Visual Studio does so at the moment these are disabled for VS.
2016-09-28 09:43:13 -06:00
Casey Carter
67717ea6ae [multi_span] Fix UB hack in static_bounds::operator=
* Make BoundsRanges<dynamic_range, ...>::m_bound non-const and private

* Remove various defaulted copy constructor/assignment declarations from BoundsRanges specializations whose only effect is to needlessly suppress the generation of moves

* Remove the hackish static_bounds::operator=(const static_bounds&). The implicitly generated default is now sufficient
2016-09-27 21:12:51 -07:00
Neil MacIntosh
348a859547 Removed redundant static_cast<> and is_same<> test. 2016-09-22 10:22:07 -07:00
Neil MacIntosh
e4a34128a8 Turn off warning about function-style casts in gsl_byte 2016-09-21 13:21:14 -07:00
Michael Balszun
4e7997190c Turn off warning about function-styl casts in gsl_byte 2016-09-21 21:39:28 +02:00
Neil MacIntosh
fd5ad87bf2 Add tests for to_integer(), fix to_integer() 2016-09-20 08:47:49 -07:00
Neil MacIntosh
e4de6cccdd Fix wrong types in multi_span_test for comparison operators. 2016-09-20 08:46:27 -07:00
Neil MacIntosh
75fb2236ed Fix negative indices to multi_span not being caught.
Negative indices to multi_span are not flagged with neither exception nor abort.
2016-09-20 08:44:41 -07:00
Krzysztof Wrzalik
6cb0e3082a Added a fix for not flagging negative indices to multi_span. 2016-09-18 17:56:18 +02:00
Krzysztof Wrzalik
22c2785452 Added tests for negative multi-span access. 2016-09-18 17:44:45 +02:00
Michael Balszun
95f465aeca fix wrong types in multi_span_test (<comparison_operators>) 2016-09-17 16:09:21 +02:00
Martin Moene
6cf154e067 Fix to_integer() 2016-09-17 09:24:34 +02:00
Martin Moene
ad991370da Add tests for to_integer(): they fail 2016-09-17 09:16:15 +02:00
Neil MacIntosh
831be5de39 Removed redundant static_cast<> and is_same<> test. 2016-09-14 22:01:02 -07:00
Neil MacIntosh
8361aae39e Adding inline to all byte-related functions for MSVC 2013. 2016-09-14 11:41:24 -07:00
Neil MacIntosh
edceed8075 Adding inline to all byte-related functions for MSVC 2013. 2016-09-13 14:30:02 -07:00
Neil MacIntosh
6bc1e7e709 Fix for #313 Corrected SFINAE for conversion constructors on span 2016-09-13 12:19:19 -07:00
Neil MacIntosh
e40729a561 Added inline to byte member functions to fix MSVC 2013 warnings 2016-09-13 12:17:17 -07:00
Neil MacIntosh
2d74fd5c84 Added to_byte() helper function to fix issue #329 2016-09-13 12:10:42 -07:00
Steve Brain
ad5275ca78 Added inline to fix compilation warnings on msvc 2013 2016-09-13 16:07:34 +10:00
Neil MacIntosh
bc70a93bba Removed unnecessary reinterpret_cast<> from span implementation. 2016-09-12 19:06:45 -07:00
Neil MacIntosh
3b2419532e Corrected SFINAE for conversion constructors on span. 2016-09-12 18:51:23 -07:00
Kris
d5847ceef0 Merge remote-tracking branch 'Microsoft/master' 2016-09-07 22:16:19 +01:00
Kris
7d083fd08c Issue #329, fixed build issues on clang
Fixed build issues that clang shows up the MS VS accepts.
2016-09-07 22:16:10 +01:00
Kris Cruickshank
55b232dde4 Issue: #329
This is my best attempt at fixing the issues raised by @gdr-at-ms while supporting VS2013, VS2015, providing shorter syntax than the static_cast and giving developer meaningful errors when they do the wrong thing.
2016-09-07 21:38:43 +01:00
Neil MacIntosh
d23f4d931c Fix #350 typo in operator | for gsl::byte. 2016-09-06 18:50:32 -07:00
Neil MacIntosh
9e0807f1b1 Fix typo in operator | for gsl::byte. 2016-09-06 18:45:53 -07:00
Neil MacIntosh
a360b81805 Fix #247: add to_basic_string().
Add to_basic_string
2016-09-04 14:12:40 -07:00
Gary Furnish
ec109d2374 Add to_basic_string 2016-09-04 00:29:10 -06:00
Kris
95bbaa1ec2 Added to_byte method for issue #329
I have added the to_byte method and updated the unit tests.

This gives slightly nicer syntax than static_cast, is better than the
c-style cast used in the unit test.

See: https://github.com/Microsoft/GSL/issues/329#issuecomment-240588515
2016-08-28 21:55:58 +01:00
Neil MacIntosh
f8ef4e2355 Fix #340: define constexpr as /*constexpr*/ when unavailable (also noexcept) 2016-08-27 10:51:00 -07:00
Neil MacIntosh
5e2618b034 Specialize gsl::at for span 2016-08-25 08:35:52 -07:00
Martin Moene
3aea9f7201 Define constexpr as /*constexpr*/ when unavailable (also noexcept) 2016-08-24 19:53:53 +02:00
Neil MacIntosh
deda5e6c46 Fix #332: update CMakeLists.txt to install all headers 2016-08-24 10:13:02 -07:00
Neil MacIntosh
a8c5004b70 Update CMakeLists.txt 2016-08-24 10:01:42 -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
5112ba02f6 Fix issue #315: Provide platform support for strnlen 2016-08-19 09:26:49 -07:00
Rian Quinn
aadcce275e Fix issue: Provide platform support for strnlen
Not all platforms have support for strnlen (e.g. cygwin) as this is a non-standard function. This patch provides a custom implementation of strnlen for these platforms.
2016-08-18 20:32:08 -06:00
Neil MacIntosh
93b3258e36 Fix #323 - Badly positioned noexcept 2016-08-15 11:25:43 -07:00
Neil MacIntosh
90f47cca12 Fix inconsistent naming 2016-08-15 11:22:45 -07:00
EFanZh
2d4b552c82 Fix inconsistent naming 2016-08-14 13:20:32 +08:00
Vincent Isambart
36d56ebcb3 Add missing newline at end of file 2016-08-13 10:16:59 +09:00
Vincent Isambart
582ae8c87f Fix #323 - Badly positioned noexcept 2016-08-13 10:15:59 +09: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
85b5c3770c Support iterator conversions as per Issue #252 2016-08-10 19:25:31 -07:00