This implements <valarray> related parts of section 4.8. of P3016R6.
This is treated as DR against C++11 (to expose array begin/end), to follow
similar changes to other semi-containers that were accepted as LWG issues
and treated as DR: <optional> (LWG4131), <stacktrace> (LWG3625).
libstdc++-v3/ChangeLog:
* include/std/valarray [__cplusplus >= 201103L]: Include
<bits/ranges_access.h>.
* testsuite/26_numerics/valarray/range_access2.cc: Remove
<iterator> include, and add test for std::size.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
#include <debug/debug.h>
#if __cplusplus >= 201103L
#include <initializer_list>
+#include <bits/range_access.h>
#endif
namespace std _GLIBCXX_VISIBILITY(default)
// C++11 26.6.10 valarray range access: [valarray.range]
-#include <iterator>
#include <valarray>
// PR libstdc++/67374
(void) std::cend(cva);
}
+// P3016R6 4.8
+void
+test03()
+{
+#if __cplusplus >= 201703L
+ std::valarray<double> va;
+ (void) std::size(va);
+ const auto& cva = va;
+ (void) std::size(cva);
+#endif
+}
+
int main()
{
test01();
test02();
+ test03();
}