From 45e5b1ebcf67ade630a3e7195fff899677465a0a Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Fri, 13 May 2022 21:33:53 -0400 Subject: [PATCH] Add test around the MSVC defect --- test/Jamfile.v2 | 1 + test/span_boost_begin_test.cpp | 37 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 test/span_boost_begin_test.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 71a6544..373be22 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -331,6 +331,7 @@ run span_constructible_test.cpp ; run span_deduction_guide_test.cpp ; run as_bytes_test.cpp ; run as_writable_bytes_test.cpp ; +compile span_boost_begin_test.cpp ; run splitmix64_test.cpp : : : $(pedantic-errors) ; diff --git a/test/span_boost_begin_test.cpp b/test/span_boost_begin_test.cpp new file mode 100644 index 0000000..9da849a --- /dev/null +++ b/test/span_boost_begin_test.cpp @@ -0,0 +1,37 @@ +/* +Copyright 2022 Glen Joseph Fernandes +(glenjofe@gmail.com) + +Distributed under the Boost Software License, Version 1.0. +(http://www.boost.org/LICENSE_1_0.txt) +*/ +#include +#if !defined(BOOST_NO_CXX11_CONSTEXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) +#include +#include + +namespace boost { +namespace begin_ { + +template +void begin(T&) { } + +} // begin_ + +using namespace begin_; + +} // boost + +template class boost::span; + +void function() +{ + std::vector y; + boost::begin(y); +} +#else +int main() +{ + return 0; +} +#endif