2019-02-06 20:40:57 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
|
|
|
|
//
|
|
|
|
// This code is licensed under the MIT License (MIT).
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
// THE SOFTWARE.
|
|
|
|
//
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-02-11 19:00:07 -05:00
|
|
|
// #include <gsl/gsl_byte> // for byte
|
|
|
|
// #include <gsl/gsl_util> // for narrow_cast, at
|
2019-02-06 20:40:57 -05:00
|
|
|
#include <gsl/span> // for span, span_iterator, operator==, operator!=
|
|
|
|
|
2019-02-11 19:00:07 -05:00
|
|
|
// #include <array> // for array
|
|
|
|
// #include <iostream> // for ptrdiff_t
|
|
|
|
// #include <iterator> // for reverse_iterator, operator-, operator==
|
|
|
|
// #include <memory> // for unique_ptr, shared_ptr, make_unique, allo...
|
|
|
|
// #include <regex> // for match_results, sub_match, match_results<>...
|
|
|
|
// #include <stddef.h> // for ptrdiff_t
|
|
|
|
// #include <string> // for string
|
|
|
|
// #include <type_traits> // for integral_constant<>::value, is_default_co...
|
2019-02-27 18:48:18 -05:00
|
|
|
#include <vector> // for vector
|
2019-02-06 20:40:57 -05:00
|
|
|
|
|
|
|
namespace gsl {
|
|
|
|
struct fail_fast;
|
|
|
|
} // namespace gsl
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace gsl;
|
|
|
|
|
|
|
|
GSL_SUPPRESS(con.4) // NO-FORMAT: attribute
|
2019-02-07 12:00:30 -05:00
|
|
|
bool foo()
|
2019-02-06 20:40:57 -05:00
|
|
|
{
|
|
|
|
{
|
2019-02-07 12:00:30 -05:00
|
|
|
bool ret = true;
|
2019-02-06 20:40:57 -05:00
|
|
|
span<int> s;
|
2019-02-07 12:00:30 -05:00
|
|
|
ret = ret || (s.size() == 0 && s.data() == nullptr);
|
2019-02-06 20:40:57 -05:00
|
|
|
|
|
|
|
span<const int> cs;
|
2019-02-07 12:00:30 -05:00
|
|
|
ret = ret || (cs.size() == 0 && cs.data() == nullptr);
|
|
|
|
|
2019-02-27 18:33:23 -05:00
|
|
|
span<int> s2{};
|
|
|
|
ret = ret || (s2.size() == 0 && s2.data() == nullptr);
|
2019-02-12 23:00:52 -05:00
|
|
|
|
2019-02-07 12:00:30 -05:00
|
|
|
return ret;
|
2019-02-06 20:40:57 -05:00
|
|
|
}
|
|
|
|
}
|
2019-02-27 18:48:18 -05:00
|
|
|
|
|
|
|
|
|
|
|
GSL_SUPPRESS(con.4) // NO-FORMAT: attribute
|
|
|
|
bool bar()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool ret = true;
|
|
|
|
vector<int> v{0,1,2,3};
|
|
|
|
span<int> s{v};
|
|
|
|
ret = ret || (s.size() == 4 && s.data() != nullptr);
|
|
|
|
|
2019-02-28 20:56:02 -05:00
|
|
|
int x = s.size() + v.size();
|
|
|
|
|
|
|
|
return ret || x > 23;
|
2019-02-27 18:48:18 -05:00
|
|
|
}
|
2019-02-27 19:55:31 -05:00
|
|
|
}
|