[libcxx] [test] Strip trailing whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@346826 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -32,7 +32,7 @@ struct Throws {
|
|||||||
|
|
||||||
static bool sThrows;
|
static bool sThrows;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool Throws::sThrows = false;
|
bool Throws::sThrows = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ struct Throws {
|
|||||||
|
|
||||||
static bool sThrows;
|
static bool sThrows;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool Throws::sThrows = false;
|
bool Throws::sThrows = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -7,13 +7,13 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
|
// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
|
||||||
// constexpr bool operator==(span<T, X> l, span<U, Y> r);
|
// constexpr bool operator==(span<T, X> l, span<U, Y> r);
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Effects: Equivalent to: return equal(l.begin(), l.end(), r.begin(), r.end());
|
// Effects: Equivalent to: return equal(l.begin(), l.end(), r.begin(), r.end());
|
||||||
//
|
//
|
||||||
@@ -30,7 +30,7 @@ constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
|||||||
int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
||||||
constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
||||||
float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
||||||
|
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
|
|
||||||
@@ -50,15 +50,15 @@ int main () {
|
|||||||
static_assert( (csp0s == csp0s), "");
|
static_assert( (csp0s == csp0s), "");
|
||||||
static_assert( (csp0s == csp0d), "");
|
static_assert( (csp0s == csp0d), "");
|
||||||
static_assert( (csp0d == csp0s), "");
|
static_assert( (csp0d == csp0s), "");
|
||||||
|
|
||||||
static_assert(!(csp0d == csp1d), "");
|
static_assert(!(csp0d == csp1d), "");
|
||||||
static_assert(!(csp0s == csp1s), "");
|
static_assert(!(csp0s == csp1s), "");
|
||||||
static_assert(!(csp0s == csp1d), "");
|
static_assert(!(csp0s == csp1d), "");
|
||||||
static_assert(!(csp0d == csp1s), "");
|
static_assert(!(csp0d == csp1s), "");
|
||||||
|
|
||||||
static_assert( (csp1d == csp1s), "");
|
static_assert( (csp1d == csp1s), "");
|
||||||
static_assert( (csp1s == csp1d), "");
|
static_assert( (csp1s == csp1d), "");
|
||||||
|
|
||||||
static_assert( (csp2d == csp3d), "");
|
static_assert( (csp2d == csp3d), "");
|
||||||
static_assert( (csp2s == csp3s), "");
|
static_assert( (csp2s == csp3s), "");
|
||||||
static_assert( (csp2d == csp3s), "");
|
static_assert( (csp2d == csp3s), "");
|
||||||
@@ -95,15 +95,15 @@ int main () {
|
|||||||
assert( (sp0s == sp0s));
|
assert( (sp0s == sp0s));
|
||||||
assert( (sp0s == sp0d));
|
assert( (sp0s == sp0d));
|
||||||
assert( (sp0d == sp0s));
|
assert( (sp0d == sp0s));
|
||||||
|
|
||||||
assert(!(sp0d == sp1d));
|
assert(!(sp0d == sp1d));
|
||||||
assert(!(sp0s == sp1s));
|
assert(!(sp0s == sp1s));
|
||||||
assert(!(sp0s == sp1d));
|
assert(!(sp0s == sp1d));
|
||||||
assert(!(sp0d == sp1s));
|
assert(!(sp0d == sp1s));
|
||||||
|
|
||||||
assert( (sp1d == sp1s));
|
assert( (sp1d == sp1s));
|
||||||
assert( (sp1s == sp1d));
|
assert( (sp1s == sp1d));
|
||||||
|
|
||||||
assert( (sp2d == sp3d));
|
assert( (sp2d == sp3d));
|
||||||
assert( (sp2s == sp3s));
|
assert( (sp2s == sp3s));
|
||||||
assert( (sp2d == sp3s));
|
assert( (sp2d == sp3s));
|
||||||
@@ -129,15 +129,15 @@ int main () {
|
|||||||
assert( (csp0s == sp0s));
|
assert( (csp0s == sp0s));
|
||||||
assert( (csp0s == sp0d));
|
assert( (csp0s == sp0d));
|
||||||
assert( (csp0d == sp0s));
|
assert( (csp0d == sp0s));
|
||||||
|
|
||||||
assert(!(csp0d == sp1d));
|
assert(!(csp0d == sp1d));
|
||||||
assert(!(csp0s == sp1s));
|
assert(!(csp0s == sp1s));
|
||||||
assert(!(csp0s == sp1d));
|
assert(!(csp0s == sp1d));
|
||||||
assert(!(csp0d == sp1s));
|
assert(!(csp0d == sp1s));
|
||||||
|
|
||||||
assert( (csp1d == sp1s));
|
assert( (csp1d == sp1s));
|
||||||
assert( (csp1s == sp1d));
|
assert( (csp1s == sp1d));
|
||||||
|
|
||||||
assert( (csp2d == sp3d));
|
assert( (csp2d == sp3d));
|
||||||
assert( (csp2s == sp3s));
|
assert( (csp2s == sp3s));
|
||||||
assert( (csp2d == sp3s));
|
assert( (csp2d == sp3s));
|
||||||
@@ -152,7 +152,7 @@ int main () {
|
|||||||
assert(!(csp2s == sp4s));
|
assert(!(csp2s == sp4s));
|
||||||
assert(!(csp2d == sp4s));
|
assert(!(csp2d == sp4s));
|
||||||
assert(!(csp2s == sp4d));
|
assert(!(csp2s == sp4d));
|
||||||
|
|
||||||
assert(!(csp4d == sp2d));
|
assert(!(csp4d == sp2d));
|
||||||
assert(!(csp4s == sp2s));
|
assert(!(csp4s == sp2s));
|
||||||
assert(!(csp4d == sp2s));
|
assert(!(csp4d == sp2s));
|
||||||
@@ -165,4 +165,4 @@ int main () {
|
|||||||
assert(std::span<int>{iArr2} == std::span<float>{fArr2});
|
assert(std::span<int>{iArr2} == std::span<float>{fArr2});
|
||||||
|
|
||||||
static_assert(!(std::span<const int>{iArr1, 9} == std::span<const float>{fArr1, 8}), "");
|
static_assert(!(std::span<const int>{iArr1, 9} == std::span<const float>{fArr1, 8}), "");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,13 +7,13 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
|
// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
|
||||||
// constexpr bool operator>=(span<T, X> l, span<U, Y> r);
|
// constexpr bool operator>=(span<T, X> l, span<U, Y> r);
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Effects: Equivalent to: return !(l < r);
|
// Effects: Equivalent to: return !(l < r);
|
||||||
//
|
//
|
||||||
@@ -30,7 +30,7 @@ constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
|||||||
int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
||||||
constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
||||||
float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
||||||
|
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
|
|
||||||
@@ -50,15 +50,15 @@ int main () {
|
|||||||
static_assert( (csp0s >= csp0s), "");
|
static_assert( (csp0s >= csp0s), "");
|
||||||
static_assert( (csp0s >= csp0d), "");
|
static_assert( (csp0s >= csp0d), "");
|
||||||
static_assert( (csp0d >= csp0s), "");
|
static_assert( (csp0d >= csp0s), "");
|
||||||
|
|
||||||
static_assert(!(csp0d >= csp1d), "");
|
static_assert(!(csp0d >= csp1d), "");
|
||||||
static_assert(!(csp0s >= csp1s), "");
|
static_assert(!(csp0s >= csp1s), "");
|
||||||
static_assert(!(csp0s >= csp1d), "");
|
static_assert(!(csp0s >= csp1d), "");
|
||||||
static_assert(!(csp0d >= csp1s), "");
|
static_assert(!(csp0d >= csp1s), "");
|
||||||
|
|
||||||
static_assert( (csp1d >= csp1s), "");
|
static_assert( (csp1d >= csp1s), "");
|
||||||
static_assert( (csp1s >= csp1d), "");
|
static_assert( (csp1s >= csp1d), "");
|
||||||
|
|
||||||
static_assert( (csp2d >= csp3d), "");
|
static_assert( (csp2d >= csp3d), "");
|
||||||
static_assert( (csp2s >= csp3s), "");
|
static_assert( (csp2s >= csp3s), "");
|
||||||
static_assert( (csp2d >= csp3s), "");
|
static_assert( (csp2d >= csp3s), "");
|
||||||
@@ -90,15 +90,15 @@ int main () {
|
|||||||
assert( (sp0s >= sp0s));
|
assert( (sp0s >= sp0s));
|
||||||
assert( (sp0s >= sp0d));
|
assert( (sp0s >= sp0d));
|
||||||
assert( (sp0d >= sp0s));
|
assert( (sp0d >= sp0s));
|
||||||
|
|
||||||
assert(!(sp0d >= sp1d));
|
assert(!(sp0d >= sp1d));
|
||||||
assert(!(sp0s >= sp1s));
|
assert(!(sp0s >= sp1s));
|
||||||
assert(!(sp0s >= sp1d));
|
assert(!(sp0s >= sp1d));
|
||||||
assert(!(sp0d >= sp1s));
|
assert(!(sp0d >= sp1s));
|
||||||
|
|
||||||
assert( (sp1d >= sp1s));
|
assert( (sp1d >= sp1s));
|
||||||
assert( (sp1s >= sp1d));
|
assert( (sp1s >= sp1d));
|
||||||
|
|
||||||
assert( (sp2d >= sp3d));
|
assert( (sp2d >= sp3d));
|
||||||
assert( (sp2s >= sp3s));
|
assert( (sp2s >= sp3s));
|
||||||
assert( (sp2d >= sp3s));
|
assert( (sp2d >= sp3s));
|
||||||
@@ -119,15 +119,15 @@ int main () {
|
|||||||
assert( (csp0s >= sp0s));
|
assert( (csp0s >= sp0s));
|
||||||
assert( (csp0s >= sp0d));
|
assert( (csp0s >= sp0d));
|
||||||
assert( (csp0d >= sp0s));
|
assert( (csp0d >= sp0s));
|
||||||
|
|
||||||
assert(!(csp0d >= sp1d));
|
assert(!(csp0d >= sp1d));
|
||||||
assert(!(csp0s >= sp1s));
|
assert(!(csp0s >= sp1s));
|
||||||
assert(!(csp0s >= sp1d));
|
assert(!(csp0s >= sp1d));
|
||||||
assert(!(csp0d >= sp1s));
|
assert(!(csp0d >= sp1s));
|
||||||
|
|
||||||
assert( (csp1d >= sp1s));
|
assert( (csp1d >= sp1s));
|
||||||
assert( (csp1s >= sp1d));
|
assert( (csp1s >= sp1d));
|
||||||
|
|
||||||
assert( (csp2d >= sp3d));
|
assert( (csp2d >= sp3d));
|
||||||
assert( (csp2s >= sp3s));
|
assert( (csp2s >= sp3s));
|
||||||
assert( (csp2d >= sp3s));
|
assert( (csp2d >= sp3s));
|
||||||
@@ -137,7 +137,7 @@ int main () {
|
|||||||
assert(!(csp2s >= sp4s));
|
assert(!(csp2s >= sp4s));
|
||||||
assert(!(csp2d >= sp4s));
|
assert(!(csp2d >= sp4s));
|
||||||
assert(!(csp2s >= sp4d));
|
assert(!(csp2s >= sp4d));
|
||||||
|
|
||||||
assert( (csp4d > sp2d));
|
assert( (csp4d > sp2d));
|
||||||
assert( (csp4s > sp2s));
|
assert( (csp4s > sp2s));
|
||||||
assert( (csp4d > sp2s));
|
assert( (csp4d > sp2s));
|
||||||
|
|||||||
@@ -7,13 +7,13 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
|
// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
|
||||||
// constexpr bool operator>(span<T, X> l, span<U, Y> r);
|
// constexpr bool operator>(span<T, X> l, span<U, Y> r);
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Effects: Equivalent to: return (r < l);
|
// Effects: Equivalent to: return (r < l);
|
||||||
//
|
//
|
||||||
@@ -30,7 +30,7 @@ constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
|||||||
int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
||||||
constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
||||||
float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
||||||
|
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
|
|
||||||
@@ -50,15 +50,15 @@ int main () {
|
|||||||
static_assert(!(csp0s > csp0s), "");
|
static_assert(!(csp0s > csp0s), "");
|
||||||
static_assert(!(csp0s > csp0d), "");
|
static_assert(!(csp0s > csp0d), "");
|
||||||
static_assert(!(csp0d > csp0s), "");
|
static_assert(!(csp0d > csp0s), "");
|
||||||
|
|
||||||
static_assert(!(csp0d > csp1d), "");
|
static_assert(!(csp0d > csp1d), "");
|
||||||
static_assert(!(csp0s > csp1s), "");
|
static_assert(!(csp0s > csp1s), "");
|
||||||
static_assert(!(csp0s > csp1d), "");
|
static_assert(!(csp0s > csp1d), "");
|
||||||
static_assert(!(csp0d > csp1s), "");
|
static_assert(!(csp0d > csp1s), "");
|
||||||
|
|
||||||
static_assert(!(csp1d > csp1s), "");
|
static_assert(!(csp1d > csp1s), "");
|
||||||
static_assert(!(csp1s > csp1d), "");
|
static_assert(!(csp1s > csp1d), "");
|
||||||
|
|
||||||
static_assert(!(csp2d > csp3d), "");
|
static_assert(!(csp2d > csp3d), "");
|
||||||
static_assert(!(csp2s > csp3s), "");
|
static_assert(!(csp2s > csp3s), "");
|
||||||
static_assert(!(csp2d > csp3s), "");
|
static_assert(!(csp2d > csp3s), "");
|
||||||
@@ -90,15 +90,15 @@ int main () {
|
|||||||
assert(!(sp0s > sp0s));
|
assert(!(sp0s > sp0s));
|
||||||
assert(!(sp0s > sp0d));
|
assert(!(sp0s > sp0d));
|
||||||
assert(!(sp0d > sp0s));
|
assert(!(sp0d > sp0s));
|
||||||
|
|
||||||
assert(!(sp0d > sp1d));
|
assert(!(sp0d > sp1d));
|
||||||
assert(!(sp0s > sp1s));
|
assert(!(sp0s > sp1s));
|
||||||
assert(!(sp0s > sp1d));
|
assert(!(sp0s > sp1d));
|
||||||
assert(!(sp0d > sp1s));
|
assert(!(sp0d > sp1s));
|
||||||
|
|
||||||
assert(!(sp1d > sp1s));
|
assert(!(sp1d > sp1s));
|
||||||
assert(!(sp1s > sp1d));
|
assert(!(sp1s > sp1d));
|
||||||
|
|
||||||
assert(!(sp2d > sp3d));
|
assert(!(sp2d > sp3d));
|
||||||
assert(!(sp2s > sp3s));
|
assert(!(sp2s > sp3s));
|
||||||
assert(!(sp2d > sp3s));
|
assert(!(sp2d > sp3s));
|
||||||
@@ -119,15 +119,15 @@ int main () {
|
|||||||
assert(!(csp0s > sp0s));
|
assert(!(csp0s > sp0s));
|
||||||
assert(!(csp0s > sp0d));
|
assert(!(csp0s > sp0d));
|
||||||
assert(!(csp0d > sp0s));
|
assert(!(csp0d > sp0s));
|
||||||
|
|
||||||
assert(!(csp0d > sp1d));
|
assert(!(csp0d > sp1d));
|
||||||
assert(!(csp0s > sp1s));
|
assert(!(csp0s > sp1s));
|
||||||
assert(!(csp0s > sp1d));
|
assert(!(csp0s > sp1d));
|
||||||
assert(!(csp0d > sp1s));
|
assert(!(csp0d > sp1s));
|
||||||
|
|
||||||
assert(!(csp1d > sp1s));
|
assert(!(csp1d > sp1s));
|
||||||
assert(!(csp1s > sp1d));
|
assert(!(csp1s > sp1d));
|
||||||
|
|
||||||
assert(!(csp2d > sp3d));
|
assert(!(csp2d > sp3d));
|
||||||
assert(!(csp2s > sp3s));
|
assert(!(csp2s > sp3s));
|
||||||
assert(!(csp2d > sp3s));
|
assert(!(csp2d > sp3s));
|
||||||
@@ -137,7 +137,7 @@ int main () {
|
|||||||
assert(!(csp2s > sp4s));
|
assert(!(csp2s > sp4s));
|
||||||
assert(!(csp2d > sp4s));
|
assert(!(csp2d > sp4s));
|
||||||
assert(!(csp2s > sp4d));
|
assert(!(csp2s > sp4d));
|
||||||
|
|
||||||
assert( (csp4d > sp2d));
|
assert( (csp4d > sp2d));
|
||||||
assert( (csp4s > sp2s));
|
assert( (csp4s > sp2s));
|
||||||
assert( (csp4d > sp2s));
|
assert( (csp4d > sp2s));
|
||||||
@@ -151,4 +151,4 @@ int main () {
|
|||||||
assert(!(std::span<int>{iArr2} > std::span<float>{fArr2}));
|
assert(!(std::span<int>{iArr2} > std::span<float>{fArr2}));
|
||||||
|
|
||||||
static_assert( (std::span<const int>{iArr1, 9} > std::span<const float>{fArr1, 8}), "");
|
static_assert( (std::span<const int>{iArr1, 9} > std::span<const float>{fArr1, 8}), "");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,13 +7,13 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
|
// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
|
||||||
// constexpr bool operator<=(span<T, X> l, span<U, Y> r);
|
// constexpr bool operator<=(span<T, X> l, span<U, Y> r);
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Effects: Equivalent to: return !(r < l);
|
// Effects: Equivalent to: return !(r < l);
|
||||||
//
|
//
|
||||||
@@ -30,7 +30,7 @@ constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
|||||||
int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
||||||
constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
||||||
float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
||||||
|
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
|
|
||||||
@@ -50,15 +50,15 @@ int main () {
|
|||||||
static_assert( (csp0s <= csp0s), "");
|
static_assert( (csp0s <= csp0s), "");
|
||||||
static_assert( (csp0s <= csp0d), "");
|
static_assert( (csp0s <= csp0d), "");
|
||||||
static_assert( (csp0d <= csp0s), "");
|
static_assert( (csp0d <= csp0s), "");
|
||||||
|
|
||||||
static_assert( (csp0d <= csp1d), "");
|
static_assert( (csp0d <= csp1d), "");
|
||||||
static_assert( (csp0s <= csp1s), "");
|
static_assert( (csp0s <= csp1s), "");
|
||||||
static_assert( (csp0s <= csp1d), "");
|
static_assert( (csp0s <= csp1d), "");
|
||||||
static_assert( (csp0d <= csp1s), "");
|
static_assert( (csp0d <= csp1s), "");
|
||||||
|
|
||||||
static_assert( (csp1d <= csp1s), "");
|
static_assert( (csp1d <= csp1s), "");
|
||||||
static_assert( (csp1s <= csp1d), "");
|
static_assert( (csp1s <= csp1d), "");
|
||||||
|
|
||||||
static_assert( (csp2d <= csp3d), "");
|
static_assert( (csp2d <= csp3d), "");
|
||||||
static_assert( (csp2s <= csp3s), "");
|
static_assert( (csp2s <= csp3s), "");
|
||||||
static_assert( (csp2d <= csp3s), "");
|
static_assert( (csp2d <= csp3s), "");
|
||||||
@@ -90,15 +90,15 @@ int main () {
|
|||||||
assert( (sp0s <= sp0s));
|
assert( (sp0s <= sp0s));
|
||||||
assert( (sp0s <= sp0d));
|
assert( (sp0s <= sp0d));
|
||||||
assert( (sp0d <= sp0s));
|
assert( (sp0d <= sp0s));
|
||||||
|
|
||||||
assert( (sp0d <= sp1d));
|
assert( (sp0d <= sp1d));
|
||||||
assert( (sp0s <= sp1s));
|
assert( (sp0s <= sp1s));
|
||||||
assert( (sp0s <= sp1d));
|
assert( (sp0s <= sp1d));
|
||||||
assert( (sp0d <= sp1s));
|
assert( (sp0d <= sp1s));
|
||||||
|
|
||||||
assert( (sp1d <= sp1s));
|
assert( (sp1d <= sp1s));
|
||||||
assert( (sp1s <= sp1d));
|
assert( (sp1s <= sp1d));
|
||||||
|
|
||||||
assert( (sp2d <= sp3d));
|
assert( (sp2d <= sp3d));
|
||||||
assert( (sp2s <= sp3s));
|
assert( (sp2s <= sp3s));
|
||||||
assert( (sp2d <= sp3s));
|
assert( (sp2d <= sp3s));
|
||||||
@@ -119,15 +119,15 @@ int main () {
|
|||||||
assert( (csp0s <= sp0s));
|
assert( (csp0s <= sp0s));
|
||||||
assert( (csp0s <= sp0d));
|
assert( (csp0s <= sp0d));
|
||||||
assert( (csp0d <= sp0s));
|
assert( (csp0d <= sp0s));
|
||||||
|
|
||||||
assert( (csp0d <= sp1d));
|
assert( (csp0d <= sp1d));
|
||||||
assert( (csp0s <= sp1s));
|
assert( (csp0s <= sp1s));
|
||||||
assert( (csp0s <= sp1d));
|
assert( (csp0s <= sp1d));
|
||||||
assert( (csp0d <= sp1s));
|
assert( (csp0d <= sp1s));
|
||||||
|
|
||||||
assert( (csp1d <= sp1s));
|
assert( (csp1d <= sp1s));
|
||||||
assert( (csp1s <= sp1d));
|
assert( (csp1s <= sp1d));
|
||||||
|
|
||||||
assert( (csp2d <= sp3d));
|
assert( (csp2d <= sp3d));
|
||||||
assert( (csp2s <= sp3s));
|
assert( (csp2s <= sp3s));
|
||||||
assert( (csp2d <= sp3s));
|
assert( (csp2d <= sp3s));
|
||||||
@@ -137,7 +137,7 @@ int main () {
|
|||||||
assert( (csp2s <= sp4s));
|
assert( (csp2s <= sp4s));
|
||||||
assert( (csp2d <= sp4s));
|
assert( (csp2d <= sp4s));
|
||||||
assert( (csp2s <= sp4d));
|
assert( (csp2s <= sp4d));
|
||||||
|
|
||||||
assert(!(csp4d <= sp2d));
|
assert(!(csp4d <= sp2d));
|
||||||
assert(!(csp4s <= sp2s));
|
assert(!(csp4s <= sp2s));
|
||||||
assert(!(csp4d <= sp2s));
|
assert(!(csp4d <= sp2s));
|
||||||
@@ -148,6 +148,6 @@ int main () {
|
|||||||
static_assert(std::span<const int>{iArr1, 8} <= std::span<const float>{fArr1, 9}, "");
|
static_assert(std::span<const int>{iArr1, 8} <= std::span<const float>{fArr1, 9}, "");
|
||||||
assert( (std::span<float>{fArr2} <= std::span<int>{iArr2}));
|
assert( (std::span<float>{fArr2} <= std::span<int>{iArr2}));
|
||||||
assert( (std::span<int>{iArr2} <= std::span<float>{fArr2}));
|
assert( (std::span<int>{iArr2} <= std::span<float>{fArr2}));
|
||||||
|
|
||||||
static_assert(!(std::span<const int>{iArr1, 9} <= std::span<const float>{fArr1, 8}), "");
|
static_assert(!(std::span<const int>{iArr1, 9} <= std::span<const float>{fArr1, 8}), "");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,13 +7,13 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
|
// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
|
||||||
// constexpr bool operator<(span<T, X> l, span<U, Y> r);
|
// constexpr bool operator<(span<T, X> l, span<U, Y> r);
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Effects: Equivalent to:
|
// Effects: Equivalent to:
|
||||||
// return lexicographical_compare(l.begin(), l.end(), r.begin(), r.end());
|
// return lexicographical_compare(l.begin(), l.end(), r.begin(), r.end());
|
||||||
@@ -31,7 +31,7 @@ constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
|||||||
int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
||||||
constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
||||||
float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
||||||
|
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
|
|
||||||
@@ -51,15 +51,15 @@ int main () {
|
|||||||
static_assert(!(csp0s < csp0s), "");
|
static_assert(!(csp0s < csp0s), "");
|
||||||
static_assert(!(csp0s < csp0d), "");
|
static_assert(!(csp0s < csp0d), "");
|
||||||
static_assert(!(csp0d < csp0s), "");
|
static_assert(!(csp0d < csp0s), "");
|
||||||
|
|
||||||
static_assert( (csp0d < csp1d), "");
|
static_assert( (csp0d < csp1d), "");
|
||||||
static_assert( (csp0s < csp1s), "");
|
static_assert( (csp0s < csp1s), "");
|
||||||
static_assert( (csp0s < csp1d), "");
|
static_assert( (csp0s < csp1d), "");
|
||||||
static_assert( (csp0d < csp1s), "");
|
static_assert( (csp0d < csp1s), "");
|
||||||
|
|
||||||
static_assert(!(csp1d < csp1s), "");
|
static_assert(!(csp1d < csp1s), "");
|
||||||
static_assert(!(csp1s < csp1d), "");
|
static_assert(!(csp1s < csp1d), "");
|
||||||
|
|
||||||
static_assert(!(csp2d < csp3d), "");
|
static_assert(!(csp2d < csp3d), "");
|
||||||
static_assert(!(csp2s < csp3s), "");
|
static_assert(!(csp2s < csp3s), "");
|
||||||
static_assert(!(csp2d < csp3s), "");
|
static_assert(!(csp2d < csp3s), "");
|
||||||
@@ -91,15 +91,15 @@ int main () {
|
|||||||
assert(!(sp0s < sp0s));
|
assert(!(sp0s < sp0s));
|
||||||
assert(!(sp0s < sp0d));
|
assert(!(sp0s < sp0d));
|
||||||
assert(!(sp0d < sp0s));
|
assert(!(sp0d < sp0s));
|
||||||
|
|
||||||
assert( (sp0d < sp1d));
|
assert( (sp0d < sp1d));
|
||||||
assert( (sp0s < sp1s));
|
assert( (sp0s < sp1s));
|
||||||
assert( (sp0s < sp1d));
|
assert( (sp0s < sp1d));
|
||||||
assert( (sp0d < sp1s));
|
assert( (sp0d < sp1s));
|
||||||
|
|
||||||
assert(!(sp1d < sp1s));
|
assert(!(sp1d < sp1s));
|
||||||
assert(!(sp1s < sp1d));
|
assert(!(sp1s < sp1d));
|
||||||
|
|
||||||
assert(!(sp2d < sp3d));
|
assert(!(sp2d < sp3d));
|
||||||
assert(!(sp2s < sp3s));
|
assert(!(sp2s < sp3s));
|
||||||
assert(!(sp2d < sp3s));
|
assert(!(sp2d < sp3s));
|
||||||
@@ -120,15 +120,15 @@ int main () {
|
|||||||
assert(!(csp0s < sp0s));
|
assert(!(csp0s < sp0s));
|
||||||
assert(!(csp0s < sp0d));
|
assert(!(csp0s < sp0d));
|
||||||
assert(!(csp0d < sp0s));
|
assert(!(csp0d < sp0s));
|
||||||
|
|
||||||
assert( (csp0d < sp1d));
|
assert( (csp0d < sp1d));
|
||||||
assert( (csp0s < sp1s));
|
assert( (csp0s < sp1s));
|
||||||
assert( (csp0s < sp1d));
|
assert( (csp0s < sp1d));
|
||||||
assert( (csp0d < sp1s));
|
assert( (csp0d < sp1s));
|
||||||
|
|
||||||
assert(!(csp1d < sp1s));
|
assert(!(csp1d < sp1s));
|
||||||
assert(!(csp1s < sp1d));
|
assert(!(csp1s < sp1d));
|
||||||
|
|
||||||
assert(!(csp2d < sp3d));
|
assert(!(csp2d < sp3d));
|
||||||
assert(!(csp2s < sp3s));
|
assert(!(csp2s < sp3s));
|
||||||
assert(!(csp2d < sp3s));
|
assert(!(csp2d < sp3s));
|
||||||
@@ -138,7 +138,7 @@ int main () {
|
|||||||
assert( (csp2s < sp4s));
|
assert( (csp2s < sp4s));
|
||||||
assert( (csp2d < sp4s));
|
assert( (csp2d < sp4s));
|
||||||
assert( (csp2s < sp4d));
|
assert( (csp2s < sp4d));
|
||||||
|
|
||||||
assert(!(csp4d < sp2d));
|
assert(!(csp4d < sp2d));
|
||||||
assert(!(csp4s < sp2s));
|
assert(!(csp4s < sp2s));
|
||||||
assert(!(csp4d < sp2s));
|
assert(!(csp4d < sp2s));
|
||||||
@@ -150,5 +150,5 @@ int main () {
|
|||||||
assert(!(std::span<float>{fArr2} < std::span<int>{iArr2}));
|
assert(!(std::span<float>{fArr2} < std::span<int>{iArr2}));
|
||||||
assert(!(std::span<int>{iArr2} < std::span<float>{fArr2}));
|
assert(!(std::span<int>{iArr2} < std::span<float>{fArr2}));
|
||||||
|
|
||||||
static_assert(!(std::span<const int>{iArr1, 9} < std::span<const float>{fArr1, 8}), "");
|
static_assert(!(std::span<const int>{iArr1, 9} < std::span<const float>{fArr1, 8}), "");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,13 +7,13 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
|
// template<class T, ptrdiff_t X, class U, ptrdiff_t Y>
|
||||||
// constexpr bool operator!=(span<T, X> l, span<U, Y> r);
|
// constexpr bool operator!=(span<T, X> l, span<U, Y> r);
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Effects: Equivalent to: return !(l == r);
|
// Effects: Equivalent to: return !(l == r);
|
||||||
//
|
//
|
||||||
@@ -30,7 +30,7 @@ constexpr int iArr1[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
|||||||
int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
int iArr2[] = { 0, 1, 2, 1, 2, 5, 6, 7, 8, 9};
|
||||||
constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
constexpr float fArr1[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
||||||
float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
float fArr2[] = {0., 1., 2., 1., 2., 5., 6., 7., 8., 9.};
|
||||||
|
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
|
|
||||||
@@ -50,15 +50,15 @@ int main () {
|
|||||||
static_assert(!(csp0s != csp0s), "");
|
static_assert(!(csp0s != csp0s), "");
|
||||||
static_assert(!(csp0s != csp0d), "");
|
static_assert(!(csp0s != csp0d), "");
|
||||||
static_assert(!(csp0d != csp0s), "");
|
static_assert(!(csp0d != csp0s), "");
|
||||||
|
|
||||||
static_assert( (csp0d != csp1d), "");
|
static_assert( (csp0d != csp1d), "");
|
||||||
static_assert( (csp0s != csp1s), "");
|
static_assert( (csp0s != csp1s), "");
|
||||||
static_assert( (csp0s != csp1d), "");
|
static_assert( (csp0s != csp1d), "");
|
||||||
static_assert( (csp0d != csp1s), "");
|
static_assert( (csp0d != csp1s), "");
|
||||||
|
|
||||||
static_assert(!(csp1d != csp1s), "");
|
static_assert(!(csp1d != csp1s), "");
|
||||||
static_assert(!(csp1s != csp1d), "");
|
static_assert(!(csp1s != csp1d), "");
|
||||||
|
|
||||||
static_assert(!(csp2d != csp3d), "");
|
static_assert(!(csp2d != csp3d), "");
|
||||||
static_assert(!(csp2s != csp3s), "");
|
static_assert(!(csp2s != csp3s), "");
|
||||||
static_assert(!(csp2d != csp3s), "");
|
static_assert(!(csp2d != csp3s), "");
|
||||||
@@ -95,15 +95,15 @@ int main () {
|
|||||||
assert(!(sp0s != sp0s));
|
assert(!(sp0s != sp0s));
|
||||||
assert(!(sp0s != sp0d));
|
assert(!(sp0s != sp0d));
|
||||||
assert(!(sp0d != sp0s));
|
assert(!(sp0d != sp0s));
|
||||||
|
|
||||||
assert( (sp0d != sp1d));
|
assert( (sp0d != sp1d));
|
||||||
assert( (sp0s != sp1s));
|
assert( (sp0s != sp1s));
|
||||||
assert( (sp0s != sp1d));
|
assert( (sp0s != sp1d));
|
||||||
assert( (sp0d != sp1s));
|
assert( (sp0d != sp1s));
|
||||||
|
|
||||||
assert(!(sp1d != sp1s));
|
assert(!(sp1d != sp1s));
|
||||||
assert(!(sp1s != sp1d));
|
assert(!(sp1s != sp1d));
|
||||||
|
|
||||||
assert(!(sp2d != sp3d));
|
assert(!(sp2d != sp3d));
|
||||||
assert(!(sp2s != sp3s));
|
assert(!(sp2s != sp3s));
|
||||||
assert(!(sp2d != sp3s));
|
assert(!(sp2d != sp3s));
|
||||||
@@ -129,15 +129,15 @@ int main () {
|
|||||||
assert(!(csp0s != sp0s));
|
assert(!(csp0s != sp0s));
|
||||||
assert(!(csp0s != sp0d));
|
assert(!(csp0s != sp0d));
|
||||||
assert(!(csp0d != sp0s));
|
assert(!(csp0d != sp0s));
|
||||||
|
|
||||||
assert( (csp0d != sp1d));
|
assert( (csp0d != sp1d));
|
||||||
assert( (csp0s != sp1s));
|
assert( (csp0s != sp1s));
|
||||||
assert( (csp0s != sp1d));
|
assert( (csp0s != sp1d));
|
||||||
assert( (csp0d != sp1s));
|
assert( (csp0d != sp1s));
|
||||||
|
|
||||||
assert(!(csp1d != sp1s));
|
assert(!(csp1d != sp1s));
|
||||||
assert(!(csp1s != sp1d));
|
assert(!(csp1s != sp1d));
|
||||||
|
|
||||||
assert(!(csp2d != sp3d));
|
assert(!(csp2d != sp3d));
|
||||||
assert(!(csp2s != sp3s));
|
assert(!(csp2s != sp3s));
|
||||||
assert(!(csp2d != sp3s));
|
assert(!(csp2d != sp3s));
|
||||||
@@ -152,7 +152,7 @@ int main () {
|
|||||||
assert( (csp2s != sp4s));
|
assert( (csp2s != sp4s));
|
||||||
assert( (csp2d != sp4s));
|
assert( (csp2d != sp4s));
|
||||||
assert( (csp2s != sp4d));
|
assert( (csp2s != sp4d));
|
||||||
|
|
||||||
assert( (csp4d != sp2d));
|
assert( (csp4d != sp2d));
|
||||||
assert( (csp4s != sp2s));
|
assert( (csp4s != sp2s));
|
||||||
assert( (csp4d != sp2s));
|
assert( (csp4d != sp2s));
|
||||||
@@ -165,4 +165,4 @@ int main () {
|
|||||||
assert(!(std::span<int>{iArr2} != std::span<float>{fArr2}));
|
assert(!(std::span<int>{iArr2} != std::span<float>{fArr2}));
|
||||||
|
|
||||||
static_assert( (std::span<const int>{iArr1, 9} != std::span<const float>{fArr1, 8}), "");
|
static_assert( (std::span<const int>{iArr1, 9} != std::span<const float>{fArr1, 8}), "");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
// template<size_t N>
|
// template<size_t N>
|
||||||
// constexpr span(array<value_type, N>& arr) noexcept;
|
// constexpr span(array<value_type, N>& arr) noexcept;
|
||||||
// template<size_t N>
|
// template<size_t N>
|
||||||
// constexpr span(const array<value_type, N>& arr) noexcept;
|
// constexpr span(const array<value_type, N>& arr) noexcept;
|
||||||
//
|
//
|
||||||
// Remarks: These constructors shall not participate in overload resolution unless:
|
// Remarks: These constructors shall not participate in overload resolution unless:
|
||||||
// — extent == dynamic_extent || N == extent is true, and
|
// — extent == dynamic_extent || N == extent is true, and
|
||||||
@@ -41,13 +41,13 @@ int main ()
|
|||||||
{
|
{
|
||||||
std::span<int, 2> s1(arr); // expected-error {{no matching constructor for initialization of 'std::span<int, 2>'}}
|
std::span<int, 2> s1(arr); // expected-error {{no matching constructor for initialization of 'std::span<int, 2>'}}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type wrong
|
// Type wrong
|
||||||
{
|
{
|
||||||
std::span<float> s1(arr); // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
|
std::span<float> s1(arr); // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
|
||||||
std::span<float, 3> s2(arr); // expected-error {{no matching constructor for initialization of 'std::span<float, 3>'}}
|
std::span<float, 3> s2(arr); // expected-error {{no matching constructor for initialization of 'std::span<float, 3>'}}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CV wrong (dynamically sized)
|
// CV wrong (dynamically sized)
|
||||||
{
|
{
|
||||||
std::span< int> s1{ carr}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
|
std::span< int> s1{ carr}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ int main ()
|
|||||||
};
|
};
|
||||||
|
|
||||||
static_assert(std::size(spans) == 13, "" );
|
static_assert(std::size(spans) == 13, "" );
|
||||||
|
|
||||||
// No for loops in constexpr land :-(
|
// No for loops in constexpr land :-(
|
||||||
static_assert(doAssign(spans[0], spans[0]), "");
|
static_assert(doAssign(spans[0], spans[0]), "");
|
||||||
static_assert(doAssign(spans[0], spans[1]), "");
|
static_assert(doAssign(spans[0], spans[1]), "");
|
||||||
@@ -194,7 +194,7 @@ int main ()
|
|||||||
{carr2 + 1, 2},
|
{carr2 + 1, 2},
|
||||||
{carr3, 2}
|
{carr3, 2}
|
||||||
};
|
};
|
||||||
|
|
||||||
static_assert(std::size(spans) == 6, "" );
|
static_assert(std::size(spans) == 6, "" );
|
||||||
|
|
||||||
// No for loops in constexpr land :-(
|
// No for loops in constexpr land :-(
|
||||||
@@ -240,7 +240,7 @@ int main ()
|
|||||||
{arr, arr + 3},
|
{arr, arr + 3},
|
||||||
{arr + 1, arr + 3} // same size as s2
|
{arr + 1, arr + 3} // same size as s2
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0; i < std::size(spans); ++i)
|
for (size_t i = 0; i < std::size(spans); ++i)
|
||||||
for (size_t j = i; j < std::size(spans); ++j)
|
for (size_t j = i; j < std::size(spans); ++j)
|
||||||
assert((doAssign(spans[i], spans[j])));
|
assert((doAssign(spans[i], spans[j])));
|
||||||
@@ -253,7 +253,7 @@ int main ()
|
|||||||
{arr + 1, arr + 3},
|
{arr + 1, arr + 3},
|
||||||
{arr + 2, arr + 4}
|
{arr + 2, arr + 4}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0; i < std::size(spans); ++i)
|
for (size_t i = 0; i < std::size(spans); ++i)
|
||||||
for (size_t j = i; j < std::size(spans); ++j)
|
for (size_t j = i; j < std::size(spans); ++j)
|
||||||
assert((doAssign(spans[i], spans[j])));
|
assert((doAssign(spans[i], spans[j])));
|
||||||
@@ -273,7 +273,7 @@ int main ()
|
|||||||
{strs + 2, strs + 3},
|
{strs + 2, strs + 3},
|
||||||
{strs + 3, strs + 3}
|
{strs + 3, strs + 3}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0; i < std::size(spans); ++i)
|
for (size_t i = 0; i < std::size(spans); ++i)
|
||||||
for (size_t j = i; j < std::size(spans); ++j)
|
for (size_t j = i; j < std::size(spans); ++j)
|
||||||
assert((doAssign(spans[i], spans[j])));
|
assert((doAssign(spans[i], spans[j])));
|
||||||
@@ -285,7 +285,7 @@ int main ()
|
|||||||
{strs + 1, strs + 2},
|
{strs + 1, strs + 2},
|
||||||
{strs + 2, strs + 3}
|
{strs + 2, strs + 3}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t i = 0; i < std::size(spans); ++i)
|
for (size_t i = 0; i < std::size(spans); ++i)
|
||||||
for (size_t j = i; j < std::size(spans); ++j)
|
for (size_t j = i; j < std::size(spans); ++j)
|
||||||
assert((doAssign(spans[i], spans[j])));
|
assert((doAssign(spans[i], spans[j])));
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ int main ()
|
|||||||
// Not the same type
|
// Not the same type
|
||||||
{
|
{
|
||||||
std::span<float> s1{IsAContainer<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
|
std::span<float> s1{IsAContainer<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
|
||||||
std::span<float, 0> s2{IsAContainer<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<float, 0>'}}
|
std::span<float, 0> s2{IsAContainer<int>()}; // expected-error {{no matching constructor for initialization of 'std::span<float, 0>'}}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CV wrong (dynamically sized)
|
// CV wrong (dynamically sized)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ void testCV ()
|
|||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
constexpr int carr[] = {1,2,3};
|
constexpr int carr[] = {1,2,3};
|
||||||
|
|
||||||
static_assert(doCopy(std::span< int> ()), "");
|
static_assert(doCopy(std::span< int> ()), "");
|
||||||
static_assert(doCopy(std::span< int,0>()), "");
|
static_assert(doCopy(std::span< int,0>()), "");
|
||||||
static_assert(doCopy(std::span<const int> (&carr[0], 1)), "");
|
static_assert(doCopy(std::span<const int> (&carr[0], 1)), "");
|
||||||
|
|||||||
@@ -7,22 +7,22 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
// template<class T, size_t N>
|
// template<class T, size_t N>
|
||||||
// span(T (&)[N]) -> span<T, N>;
|
// span(T (&)[N]) -> span<T, N>;
|
||||||
//
|
//
|
||||||
// template<class T, size_t N>
|
// template<class T, size_t N>
|
||||||
// span(array<T, N>&) -> span<T, N>;
|
// span(array<T, N>&) -> span<T, N>;
|
||||||
//
|
//
|
||||||
// template<class T, size_t N>
|
// template<class T, size_t N>
|
||||||
// span(const array<T, N>&) -> span<const T, N>;
|
// span(const array<T, N>&) -> span<const T, N>;
|
||||||
//
|
//
|
||||||
// template<class Container>
|
// template<class Container>
|
||||||
// span(Container&) -> span<typename Container::value_type>;
|
// span(Container&) -> span<typename Container::value_type>;
|
||||||
//
|
//
|
||||||
// template<class Container>
|
// template<class Container>
|
||||||
// span(const Container&) -> span<const typename Container::value_type>;
|
// span(const Container&) -> span<const typename Container::value_type>;
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ int main ()
|
|||||||
ASSERT_SAME_TYPE(S, std::span<const long, 5>);
|
ASSERT_SAME_TYPE(S, std::span<const long, 5>);
|
||||||
assert((std::equal(std::begin(arr), std::end(arr), s.begin(), s.end())));
|
assert((std::equal(std::begin(arr), std::end(arr), s.begin(), s.end())));
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
std::string str{"ABCDE"};
|
std::string str{"ABCDE"};
|
||||||
std::span s{str};
|
std::span s{str};
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
std::span<int, 2> s; // expected-error@span:* {{static_assert failed "Can't default construct a statically sized span with size > 0"}}
|
std::span<int, 2> s; // expected-error@span:* {{static_assert failed "Can't default construct a statically sized span with size > 0"}}
|
||||||
|
|
||||||
// TODO: This is what I want:
|
// TODO: This is what I want:
|
||||||
// eXpected-error {{no matching constructor for initialization of 'std::span<int, 2>'}}
|
// eXpected-error {{no matching constructor for initialization of 'std::span<int, 2>'}}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
// constexpr span(pointer ptr, index_type count);
|
// constexpr span(pointer ptr, index_type count);
|
||||||
// Requires: [ptr, ptr + count) shall be a valid range.
|
// Requires: [ptr, ptr + count) shall be a valid range.
|
||||||
// If extent is not equal to dynamic_extent, then count shall be equal to extent.
|
// If extent is not equal to dynamic_extent, then count shall be equal to extent.
|
||||||
//
|
//
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ int main ()
|
|||||||
std::span<float> s1(arr, 3); // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
|
std::span<float> s1(arr, 3); // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
|
||||||
std::span<float, 3> s2(arr, 3); // expected-error {{no matching constructor for initialization of 'std::span<float, 3>'}}
|
std::span<float, 3> s2(arr, 3); // expected-error {{no matching constructor for initialization of 'std::span<float, 3>'}}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CV wrong (dynamically sized)
|
// CV wrong (dynamically sized)
|
||||||
{
|
{
|
||||||
std::span< int> s1{ carr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
|
std::span< int> s1{ carr, 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
// constexpr span(pointer ptr, index_type count);
|
// constexpr span(pointer ptr, index_type count);
|
||||||
// Requires: [ptr, ptr + count) shall be a valid range.
|
// Requires: [ptr, ptr + count) shall be a valid range.
|
||||||
// If extent is not equal to dynamic_extent, then count shall be equal to extent.
|
// If extent is not equal to dynamic_extent, then count shall be equal to extent.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
// constexpr span(pointer first, pointer last);
|
// constexpr span(pointer first, pointer last);
|
||||||
// Requires: [first, last) shall be a valid range.
|
// Requires: [first, last) shall be a valid range.
|
||||||
// If extent is not equal to dynamic_extent, then last - first shall be equal to extent.
|
// If extent is not equal to dynamic_extent, then last - first shall be equal to extent.
|
||||||
//
|
//
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ int main ()
|
|||||||
std::span<float> s1(arr, arr + 3); // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
|
std::span<float> s1(arr, arr + 3); // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
|
||||||
std::span<float, 3> s2(arr, arr + 3); // expected-error {{no matching constructor for initialization of 'std::span<float, 3>'}}
|
std::span<float, 3> s2(arr, arr + 3); // expected-error {{no matching constructor for initialization of 'std::span<float, 3>'}}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CV wrong (dynamically sized)
|
// CV wrong (dynamically sized)
|
||||||
{
|
{
|
||||||
std::span< int> s1{ carr, carr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
|
std::span< int> s1{ carr, carr + 3}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
// constexpr span(pointer first, pointer last);
|
// constexpr span(pointer first, pointer last);
|
||||||
// Requires: [first, last) shall be a valid range.
|
// Requires: [first, last) shall be a valid range.
|
||||||
// If extent is not equal to dynamic_extent, then last - first shall be equal to extent.
|
// If extent is not equal to dynamic_extent, then last - first shall be equal to extent.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
@@ -99,6 +99,6 @@ int main ()
|
|||||||
std::span<float> s2{sp0}; // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
|
std::span<float> s2{sp0}; // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
|
||||||
std::span<float, 0> s3{sp}; // expected-error {{no matching constructor for initialization of 'std::span<float, 0>'}}
|
std::span<float, 0> s3{sp}; // expected-error {{no matching constructor for initialization of 'std::span<float, 0>'}}
|
||||||
std::span<float, 0> s4{sp0}; // expected-error {{no matching constructor for initialization of 'std::span<float, 0>'}}
|
std::span<float, 0> s4{sp0}; // expected-error {{no matching constructor for initialization of 'std::span<float, 0>'}}
|
||||||
|
|
||||||
checkCV();
|
checkCV();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,14 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
// template<size_t N>
|
// template<size_t N>
|
||||||
// constexpr span(array<value_type, N>& arr) noexcept;
|
// constexpr span(array<value_type, N>& arr) noexcept;
|
||||||
// template<size_t N>
|
// template<size_t N>
|
||||||
// constexpr span(const array<value_type, N>& arr) noexcept;
|
// constexpr span(const array<value_type, N>& arr) noexcept;
|
||||||
//
|
//
|
||||||
// Remarks: These constructors shall not participate in overload resolution unless:
|
// Remarks: These constructors shall not participate in overload resolution unless:
|
||||||
// — extent == dynamic_extent || N == extent is true, and
|
// — extent == dynamic_extent || N == extent is true, and
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ constexpr bool testConstexprSpan(Span sp, ptrdiff_t idx)
|
|||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(noexcept(sp[idx]), "");
|
_LIBCPP_ASSERT(noexcept(sp[idx]), "");
|
||||||
_LIBCPP_ASSERT(noexcept(sp(idx)), "");
|
_LIBCPP_ASSERT(noexcept(sp(idx)), "");
|
||||||
|
|
||||||
typename Span::reference r1 = sp[idx];
|
typename Span::reference r1 = sp[idx];
|
||||||
typename Span::reference r2 = sp(idx);
|
typename Span::reference r2 = sp(idx);
|
||||||
typename Span::reference r3 = *(sp.data() + idx);
|
typename Span::reference r3 = *(sp.data() + idx);
|
||||||
@@ -41,7 +41,7 @@ void testRuntimeSpan(Span sp, ptrdiff_t idx)
|
|||||||
{
|
{
|
||||||
_LIBCPP_ASSERT(noexcept(sp[idx]), "");
|
_LIBCPP_ASSERT(noexcept(sp[idx]), "");
|
||||||
_LIBCPP_ASSERT(noexcept(sp(idx)), "");
|
_LIBCPP_ASSERT(noexcept(sp(idx)), "");
|
||||||
|
|
||||||
typename Span::reference r1 = sp[idx];
|
typename Span::reference r1 = sp[idx];
|
||||||
typename Span::reference r2 = sp(idx);
|
typename Span::reference r2 = sp(idx);
|
||||||
typename Span::reference r3 = *(sp.data() + idx);
|
typename Span::reference r3 = *(sp.data() + idx);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ void testRuntimeSpan(Span sp)
|
|||||||
assert(spBytes.extent == std::dynamic_extent);
|
assert(spBytes.extent == std::dynamic_extent);
|
||||||
else
|
else
|
||||||
assert(spBytes.extent == static_cast<std::ptrdiff_t>(sizeof(typename Span::element_type)) * sp.extent);
|
assert(spBytes.extent == static_cast<std::ptrdiff_t>(sizeof(typename Span::element_type)) * sp.extent);
|
||||||
|
|
||||||
assert((void *) spBytes.data() == (void *) sp.data());
|
assert((void *) spBytes.data() == (void *) sp.data());
|
||||||
assert(spBytes.size() == sp.size_bytes());
|
assert(spBytes.size() == sp.size_bytes());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ void testRuntimeSpan(Span sp)
|
|||||||
assert(spBytes.extent == std::dynamic_extent);
|
assert(spBytes.extent == std::dynamic_extent);
|
||||||
else
|
else
|
||||||
assert(spBytes.extent == static_cast<std::ptrdiff_t>(sizeof(typename Span::element_type)) * sp.extent);
|
assert(spBytes.extent == static_cast<std::ptrdiff_t>(sizeof(typename Span::element_type)) * sp.extent);
|
||||||
|
|
||||||
assert(static_cast<void*>(spBytes.data()) == static_cast<void*>(sp.data()));
|
assert(static_cast<void*>(spBytes.data()) == static_cast<void*>(sp.data()));
|
||||||
assert(spBytes.size() == sp.size_bytes());
|
assert(spBytes.size() == sp.size_bytes());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ int main ()
|
|||||||
static_assert(!std::span<const int>(iArr1, 3).empty(), "");
|
static_assert(!std::span<const int>(iArr1, 3).empty(), "");
|
||||||
static_assert(!std::span<const int>(iArr1, 4).empty(), "");
|
static_assert(!std::span<const int>(iArr1, 4).empty(), "");
|
||||||
static_assert(!std::span<const int>(iArr1, 5).empty(), "");
|
static_assert(!std::span<const int>(iArr1, 5).empty(), "");
|
||||||
|
|
||||||
assert( (std::span<int>().empty() ));
|
assert( (std::span<int>().empty() ));
|
||||||
assert( (std::span<long>().empty() ));
|
assert( (std::span<long>().empty() ));
|
||||||
assert( (std::span<double>().empty() ));
|
assert( (std::span<double>().empty() ));
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ int main ()
|
|||||||
{
|
{
|
||||||
using Sp = std::span<std::string>;
|
using Sp = std::span<std::string>;
|
||||||
testConstexprSpan<Sp, 0>(Sp{});
|
testConstexprSpan<Sp, 0>(Sp{});
|
||||||
|
|
||||||
testRuntimeSpan<Sp, 0>(Sp{sarr});
|
testRuntimeSpan<Sp, 0>(Sp{sarr});
|
||||||
testRuntimeSpan<Sp, 1>(Sp{sarr});
|
testRuntimeSpan<Sp, 1>(Sp{sarr});
|
||||||
testRuntimeSpan<Sp, 2>(Sp{sarr});
|
testRuntimeSpan<Sp, 2>(Sp{sarr});
|
||||||
@@ -125,7 +125,7 @@ int main ()
|
|||||||
|
|
||||||
{
|
{
|
||||||
using Sp = std::span<std::string, 5>;
|
using Sp = std::span<std::string, 5>;
|
||||||
|
|
||||||
testRuntimeSpan<Sp, 0>(Sp{sarr});
|
testRuntimeSpan<Sp, 0>(Sp{sarr});
|
||||||
testRuntimeSpan<Sp, 1>(Sp{sarr});
|
testRuntimeSpan<Sp, 1>(Sp{sarr});
|
||||||
testRuntimeSpan<Sp, 2>(Sp{sarr});
|
testRuntimeSpan<Sp, 2>(Sp{sarr});
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ int main ()
|
|||||||
{
|
{
|
||||||
using Sp = std::span<std::string>;
|
using Sp = std::span<std::string>;
|
||||||
testConstexprSpan<Sp, 0>(Sp{});
|
testConstexprSpan<Sp, 0>(Sp{});
|
||||||
|
|
||||||
testRuntimeSpan<Sp, 0>(Sp{sarr});
|
testRuntimeSpan<Sp, 0>(Sp{sarr});
|
||||||
testRuntimeSpan<Sp, 1>(Sp{sarr});
|
testRuntimeSpan<Sp, 1>(Sp{sarr});
|
||||||
testRuntimeSpan<Sp, 2>(Sp{sarr});
|
testRuntimeSpan<Sp, 2>(Sp{sarr});
|
||||||
@@ -125,7 +125,7 @@ int main ()
|
|||||||
|
|
||||||
{
|
{
|
||||||
using Sp = std::span<std::string, 5>;
|
using Sp = std::span<std::string, 5>;
|
||||||
|
|
||||||
testRuntimeSpan<Sp, 0>(Sp{sarr});
|
testRuntimeSpan<Sp, 0>(Sp{sarr});
|
||||||
testRuntimeSpan<Sp, 1>(Sp{sarr});
|
testRuntimeSpan<Sp, 1>(Sp{sarr});
|
||||||
testRuntimeSpan<Sp, 2>(Sp{sarr});
|
testRuntimeSpan<Sp, 2>(Sp{sarr});
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
|
||||||
|
|
||||||
// <span>
|
// <span>
|
||||||
|
|
||||||
@@ -25,9 +25,9 @@
|
|||||||
// using const_iterator = implementation-defined;
|
// using const_iterator = implementation-defined;
|
||||||
// using reverse_iterator = std::reverse_iterator<iterator>;
|
// using reverse_iterator = std::reverse_iterator<iterator>;
|
||||||
// using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
// using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
||||||
//
|
//
|
||||||
// static constexpr index_type extent = Extent;
|
// static constexpr index_type extent = Extent;
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <span>
|
#include <span>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@@ -71,7 +71,7 @@ void testSpan()
|
|||||||
ASSERT_SAME_TYPE(typename S::difference_type, std::ptrdiff_t);
|
ASSERT_SAME_TYPE(typename S::difference_type, std::ptrdiff_t);
|
||||||
ASSERT_SAME_TYPE(typename S::pointer, ElementType *);
|
ASSERT_SAME_TYPE(typename S::pointer, ElementType *);
|
||||||
ASSERT_SAME_TYPE(typename S::reference, ElementType &);
|
ASSERT_SAME_TYPE(typename S::reference, ElementType &);
|
||||||
|
|
||||||
static_assert(S::extent == Size); // check that it exists
|
static_assert(S::extent == Size); // check that it exists
|
||||||
|
|
||||||
testIterator<S, typename S::iterator>();
|
testIterator<S, typename S::iterator>();
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Source Licenses. See LICENSE.TXT for details.
|
// Source Licenses. See LICENSE.TXT for details.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// <execution> feature macros
|
// <execution> feature macros
|
||||||
|
|
||||||
/* Constant Value
|
/* Constant Value
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ test(const Allocator& a)
|
|||||||
typedef std::match_results<const CharT*, Allocator> SM;
|
typedef std::match_results<const CharT*, Allocator> SM;
|
||||||
SM m0(a);
|
SM m0(a);
|
||||||
SM m1(m0);
|
SM m1(m0);
|
||||||
|
|
||||||
assert(m1.size() == m0.size());
|
assert(m1.size() == m0.size());
|
||||||
assert(m1.str() == m0.str());
|
assert(m1.str() == m0.str());
|
||||||
assert(m1.get_allocator() == m0.get_allocator());
|
assert(m1.get_allocator() == m0.get_allocator());
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ test(const Allocator& a)
|
|||||||
typedef std::match_results<const CharT*, Allocator> SM;
|
typedef std::match_results<const CharT*, Allocator> SM;
|
||||||
SM m0(a);
|
SM m0(a);
|
||||||
SM m1;
|
SM m1;
|
||||||
|
|
||||||
m1 = m0;
|
m1 = m0;
|
||||||
assert(m1.size() == m0.size());
|
assert(m1.size() == m0.size());
|
||||||
assert(m1.str() == m0.str());
|
assert(m1.str() == m0.str());
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ test(const Allocator& a)
|
|||||||
typedef std::match_results<const CharT*, Allocator> SM;
|
typedef std::match_results<const CharT*, Allocator> SM;
|
||||||
SM m0(a);
|
SM m0(a);
|
||||||
SM m1;
|
SM m1;
|
||||||
|
|
||||||
m1 = std::move(m0);
|
m1 = std::move(m0);
|
||||||
assert(m1.size() == 0);
|
assert(m1.size() == 0);
|
||||||
assert(m1.str() == std::basic_string<CharT>());
|
assert(m1.str() == std::basic_string<CharT>());
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
// const Allocator& = Allocator())
|
// const Allocator& = Allocator())
|
||||||
// -> basic_string<charT, traits, Allocator>;
|
// -> basic_string<charT, traits, Allocator>;
|
||||||
//
|
//
|
||||||
// A size_type parameter type in a basic_string deduction guide refers to the size_type
|
// A size_type parameter type in a basic_string deduction guide refers to the size_type
|
||||||
// member type of the type deduced by the deduction guide.
|
// member type of the type deduced by the deduction guide.
|
||||||
//
|
//
|
||||||
// The deduction guide shall not participate in overload resolution if Allocator
|
// The deduction guide shall not participate in overload resolution if Allocator
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
// const Allocator& = Allocator())
|
// const Allocator& = Allocator())
|
||||||
// -> basic_string<charT, traits, Allocator>;
|
// -> basic_string<charT, traits, Allocator>;
|
||||||
//
|
//
|
||||||
// A size_type parameter type in a basic_string deduction guide refers to the size_type
|
// A size_type parameter type in a basic_string deduction guide refers to the size_type
|
||||||
// member type of the type deduced by the deduction guide.
|
// member type of the type deduced by the deduction guide.
|
||||||
//
|
//
|
||||||
// The deduction guide shall not participate in overload resolution if Allocator
|
// The deduction guide shall not participate in overload resolution if Allocator
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ T euclidian_addition(T rhs, T lhs)
|
|||||||
{
|
{
|
||||||
const T modulus = maxValue - minValue + 1;
|
const T modulus = maxValue - minValue + 1;
|
||||||
T ret = rhs + lhs;
|
T ret = rhs + lhs;
|
||||||
if (ret > maxValue)
|
if (ret > maxValue)
|
||||||
ret -= modulus;
|
ret -= modulus;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -31,10 +31,9 @@ T euclidian_subtraction(T lhs, T rhs)
|
|||||||
{
|
{
|
||||||
const T modulus = maxValue - minValue + 1;
|
const T modulus = maxValue - minValue + 1;
|
||||||
T ret = lhs - rhs;
|
T ret = lhs - rhs;
|
||||||
if (ret < minValue)
|
if (ret < minValue)
|
||||||
ret += modulus;
|
ret += modulus;
|
||||||
if (ret > maxValue) // this can happen if T is unsigned
|
if (ret > maxValue) // this can happen if T is unsigned
|
||||||
ret += modulus;
|
ret += modulus;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,13 +31,13 @@ int main()
|
|||||||
ASSERT_NOEXCEPT(day{});
|
ASSERT_NOEXCEPT(day{});
|
||||||
ASSERT_NOEXCEPT(day(0U));
|
ASSERT_NOEXCEPT(day(0U));
|
||||||
ASSERT_NOEXCEPT(static_cast<unsigned>(day(0U)));
|
ASSERT_NOEXCEPT(static_cast<unsigned>(day(0U)));
|
||||||
|
|
||||||
constexpr day d0{};
|
constexpr day d0{};
|
||||||
static_assert(static_cast<unsigned>(d0) == 0, "");
|
static_assert(static_cast<unsigned>(d0) == 0, "");
|
||||||
|
|
||||||
constexpr day d1{1};
|
constexpr day d1{1};
|
||||||
static_assert(static_cast<unsigned>(d1) == 1, "");
|
static_assert(static_cast<unsigned>(d1) == 1, "");
|
||||||
|
|
||||||
for (unsigned i = 0; i <= 255; ++i)
|
for (unsigned i = 0; i <= 255; ++i)
|
||||||
{
|
{
|
||||||
day day(i);
|
day day(i);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ int main()
|
|||||||
|
|
||||||
ASSERT_SAME_TYPE(day , decltype( std::declval<day&>()++));
|
ASSERT_SAME_TYPE(day , decltype( std::declval<day&>()++));
|
||||||
ASSERT_SAME_TYPE(day&, decltype(++std::declval<day&>() ));
|
ASSERT_SAME_TYPE(day&, decltype(++std::declval<day&>() ));
|
||||||
|
|
||||||
static_assert(testConstexpr<day>(), "");
|
static_assert(testConstexpr<day>(), "");
|
||||||
|
|
||||||
for (unsigned i = 10; i <= 20; ++i)
|
for (unsigned i = 10; i <= 20; ++i)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ int main()
|
|||||||
|
|
||||||
ASSERT_SAME_TYPE(day&, decltype(std::declval<day&>() += std::declval<days>()));
|
ASSERT_SAME_TYPE(day&, decltype(std::declval<day&>() += std::declval<days>()));
|
||||||
ASSERT_SAME_TYPE(day&, decltype(std::declval<day&>() -= std::declval<days>()));
|
ASSERT_SAME_TYPE(day&, decltype(std::declval<day&>() -= std::declval<days>()));
|
||||||
|
|
||||||
static_assert(testConstexpr<day, days>(), "");
|
static_assert(testConstexpr<day, days>(), "");
|
||||||
|
|
||||||
for (unsigned i = 0; i <= 10; ++i)
|
for (unsigned i = 0; i <= 10; ++i)
|
||||||
|
|||||||
@@ -30,14 +30,14 @@ int main()
|
|||||||
|
|
||||||
AssertComparisons6AreNoexcept<day>();
|
AssertComparisons6AreNoexcept<day>();
|
||||||
AssertComparisons6ReturnBool<day>();
|
AssertComparisons6ReturnBool<day>();
|
||||||
|
|
||||||
static_assert(testComparisons6Values<day>(0U, 0U), "");
|
static_assert(testComparisons6Values<day>(0U, 0U), "");
|
||||||
static_assert(testComparisons6Values<day>(0U, 1U), "");
|
static_assert(testComparisons6Values<day>(0U, 1U), "");
|
||||||
|
|
||||||
// Some 'ok' values as well
|
// Some 'ok' values as well
|
||||||
static_assert(testComparisons6Values<day>( 5U, 5U), "");
|
static_assert(testComparisons6Values<day>( 5U, 5U), "");
|
||||||
static_assert(testComparisons6Values<day>( 5U, 10U), "");
|
static_assert(testComparisons6Values<day>( 5U, 10U), "");
|
||||||
|
|
||||||
for (unsigned i = 1; i < 10; ++i)
|
for (unsigned i = 1; i < 10; ++i)
|
||||||
for (unsigned j = 1; j < 10; ++j)
|
for (unsigned j = 1; j < 10; ++j)
|
||||||
assert(testComparisons6Values<day>(i, j));
|
assert(testComparisons6Values<day>(i, j));
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ int main()
|
|||||||
|
|
||||||
ASSERT_SAME_TYPE(day, decltype(std::declval<day>() - std::declval<days>()));
|
ASSERT_SAME_TYPE(day, decltype(std::declval<day>() - std::declval<days>()));
|
||||||
ASSERT_SAME_TYPE(days, decltype(std::declval<day>() - std::declval<day>()));
|
ASSERT_SAME_TYPE(days, decltype(std::declval<day>() - std::declval<day>()));
|
||||||
|
|
||||||
static_assert(testConstexpr<day, days>(), "");
|
static_assert(testConstexpr<day, days>(), "");
|
||||||
|
|
||||||
day dy{12};
|
day dy{12};
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ int main()
|
|||||||
|
|
||||||
ASSERT_SAME_TYPE(day, decltype(std::declval<day>() + std::declval<days>()));
|
ASSERT_SAME_TYPE(day, decltype(std::declval<day>() + std::declval<days>()));
|
||||||
ASSERT_SAME_TYPE(day, decltype(std::declval<days>() + std::declval<day>()));
|
ASSERT_SAME_TYPE(day, decltype(std::declval<days>() + std::declval<day>()));
|
||||||
|
|
||||||
static_assert(testConstexpr<day, days>(), "");
|
static_assert(testConstexpr<day, days>(), "");
|
||||||
|
|
||||||
day dy{12};
|
day dy{12};
|
||||||
|
|||||||
@@ -15,31 +15,31 @@
|
|||||||
// template<class charT, class traits>
|
// template<class charT, class traits>
|
||||||
// basic_ostream<charT, traits>&
|
// basic_ostream<charT, traits>&
|
||||||
// operator<<(basic_ostream<charT, traits>& os, const day& d);
|
// operator<<(basic_ostream<charT, traits>& os, const day& d);
|
||||||
//
|
//
|
||||||
// Effects: Inserts format(fmt, d) where fmt is "%d" widened to charT.
|
// Effects: Inserts format(fmt, d) where fmt is "%d" widened to charT.
|
||||||
// If !d.ok(), appends with " is not a valid day".
|
// If !d.ok(), appends with " is not a valid day".
|
||||||
//
|
//
|
||||||
// template<class charT, class traits>
|
// template<class charT, class traits>
|
||||||
// basic_ostream<charT, traits>&
|
// basic_ostream<charT, traits>&
|
||||||
// to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const day& d);
|
// to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const day& d);
|
||||||
//
|
//
|
||||||
// Effects: Streams d into os using the format specified by the NTCTS fmt.
|
// Effects: Streams d into os using the format specified by the NTCTS fmt.
|
||||||
// fmt encoding follows the rules specified in 25.11.
|
// fmt encoding follows the rules specified in 25.11.
|
||||||
//
|
//
|
||||||
// template<class charT, class traits, class Alloc = allocator<charT>>
|
// template<class charT, class traits, class Alloc = allocator<charT>>
|
||||||
// basic_istream<charT, traits>&
|
// basic_istream<charT, traits>&
|
||||||
// from_stream(basic_istream<charT, traits>& is, const charT* fmt,
|
// from_stream(basic_istream<charT, traits>& is, const charT* fmt,
|
||||||
// day& d, basic_string<charT, traits, Alloc>* abbrev = nullptr,
|
// day& d, basic_string<charT, traits, Alloc>* abbrev = nullptr,
|
||||||
// minutes* offset = nullptr);
|
// minutes* offset = nullptr);
|
||||||
//
|
//
|
||||||
// Effects: Attempts to parse the input stream is into the day d using the format flags
|
// Effects: Attempts to parse the input stream is into the day d using the format flags
|
||||||
// given in the NTCTS fmt as specified in 25.12.
|
// given in the NTCTS fmt as specified in 25.12.
|
||||||
// If the parse fails to decode a valid day, is.setstate(ios_base::failbit)
|
// If the parse fails to decode a valid day, is.setstate(ios_base::failbit)
|
||||||
// shall be called and d shall not be modified.
|
// shall be called and d shall not be modified.
|
||||||
// If %Z is used and successfully parsed, that value will be assigned to *abbrev
|
// If %Z is used and successfully parsed, that value will be assigned to *abbrev
|
||||||
// if abbrev is non-null. If %z (or a modified variant) is used and
|
// if abbrev is non-null. If %z (or a modified variant) is used and
|
||||||
// successfully parsed, that value will be assigned to *offset if offset is non-null.
|
// successfully parsed, that value will be assigned to *offset if offset is non-null.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
using day = std::chrono::day;
|
using day = std::chrono::day;
|
||||||
|
|
||||||
static_assert(std::is_trivially_copyable_v<day>, "");
|
static_assert(std::is_trivially_copyable_v<day>, "");
|
||||||
static_assert(std::is_standard_layout_v<day>, "");
|
static_assert(std::is_standard_layout_v<day>, "");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
using last_spec = std::chrono::last_spec;
|
using last_spec = std::chrono::last_spec;
|
||||||
|
|
||||||
ASSERT_SAME_TYPE(const last_spec, decltype(std::chrono::last));
|
ASSERT_SAME_TYPE(const last_spec, decltype(std::chrono::last));
|
||||||
|
|
||||||
static_assert(std::is_trivially_copyable_v<last_spec>, "");
|
static_assert(std::is_trivially_copyable_v<last_spec>, "");
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
// constexpr chrono::month month() const noexcept;
|
// constexpr chrono::month month() const noexcept;
|
||||||
// constexpr chrono::day day() const noexcept;
|
// constexpr chrono::day day() const noexcept;
|
||||||
// constexpr bool ok() const noexcept;
|
// constexpr bool ok() const noexcept;
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@@ -34,7 +34,7 @@ int main()
|
|||||||
|
|
||||||
ASSERT_NOEXCEPT(month_day{});
|
ASSERT_NOEXCEPT(month_day{});
|
||||||
ASSERT_NOEXCEPT(month_day{month{1}, day{1}});
|
ASSERT_NOEXCEPT(month_day{month{1}, day{1}});
|
||||||
|
|
||||||
constexpr month_day md0{};
|
constexpr month_day md0{};
|
||||||
static_assert( md0.month() == month{}, "");
|
static_assert( md0.month() == month{}, "");
|
||||||
static_assert( md0.day() == day{}, "");
|
static_assert( md0.day() == day{}, "");
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
// constexpr bool ok() const noexcept;
|
// constexpr bool ok() const noexcept;
|
||||||
// Returns: true if m_.ok() is true, 1d <= d_, and d_ is less than or equal to the
|
// Returns: true if m_.ok() is true, 1d <= d_, and d_ is less than or equal to the
|
||||||
// number of days in month m_; otherwise returns false.
|
// number of days in month m_; otherwise returns false.
|
||||||
// When m_ == February, the number of days is considered to be 29.
|
// When m_ == February, the number of days is considered to be 29.
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
// Returns: x.month() == y.month() && x.day() == y.day().
|
// Returns: x.month() == y.month() && x.day() == y.day().
|
||||||
//
|
//
|
||||||
// constexpr bool operator< (const month_day& x, const month_day& y) noexcept;
|
// constexpr bool operator< (const month_day& x, const month_day& y) noexcept;
|
||||||
// Returns:
|
// Returns:
|
||||||
// If x.month() < y.month() returns true.
|
// If x.month() < y.month() returns true.
|
||||||
// Otherwise, if x.month() > y.month() returns false.
|
// Otherwise, if x.month() > y.month() returns false.
|
||||||
// Otherwise, returns x.day() < y.day().
|
// Otherwise, returns x.day() < y.day().
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@@ -35,19 +35,19 @@ int main()
|
|||||||
|
|
||||||
AssertComparisons6AreNoexcept<month_day>();
|
AssertComparisons6AreNoexcept<month_day>();
|
||||||
AssertComparisons6ReturnBool<month_day>();
|
AssertComparisons6ReturnBool<month_day>();
|
||||||
|
|
||||||
static_assert( testComparisons6(
|
static_assert( testComparisons6(
|
||||||
month_day{std::chrono::January, day{1}},
|
month_day{std::chrono::January, day{1}},
|
||||||
month_day{std::chrono::January, day{1}},
|
month_day{std::chrono::January, day{1}},
|
||||||
true, false), "");
|
true, false), "");
|
||||||
|
|
||||||
static_assert( testComparisons6(
|
static_assert( testComparisons6(
|
||||||
month_day{std::chrono::January, day{1}},
|
month_day{std::chrono::January, day{1}},
|
||||||
month_day{std::chrono::January, day{2}},
|
month_day{std::chrono::January, day{2}},
|
||||||
false, true), "");
|
false, true), "");
|
||||||
|
|
||||||
static_assert( testComparisons6(
|
static_assert( testComparisons6(
|
||||||
month_day{std::chrono::January, day{1}},
|
month_day{std::chrono::January, day{1}},
|
||||||
month_day{std::chrono::February, day{1}},
|
month_day{std::chrono::February, day{1}},
|
||||||
false, true), "");
|
false, true), "");
|
||||||
|
|
||||||
@@ -55,16 +55,16 @@ int main()
|
|||||||
for (unsigned i = 1; i < 12; ++i)
|
for (unsigned i = 1; i < 12; ++i)
|
||||||
for (unsigned j = 1; j < 12; ++j)
|
for (unsigned j = 1; j < 12; ++j)
|
||||||
assert((testComparisons6(
|
assert((testComparisons6(
|
||||||
month_day{month{i}, day{1}},
|
month_day{month{i}, day{1}},
|
||||||
month_day{month{j}, day{1}},
|
month_day{month{j}, day{1}},
|
||||||
i == j, i < j )));
|
i == j, i < j )));
|
||||||
|
|
||||||
// same month, different days
|
// same month, different days
|
||||||
for (unsigned i = 1; i < 31; ++i)
|
for (unsigned i = 1; i < 31; ++i)
|
||||||
for (unsigned j = 1; j < 31; ++j)
|
for (unsigned j = 1; j < 31; ++j)
|
||||||
assert((testComparisons6(
|
assert((testComparisons6(
|
||||||
month_day{month{2}, day{i}},
|
month_day{month{2}, day{i}},
|
||||||
month_day{month{2}, day{j}},
|
month_day{month{2}, day{j}},
|
||||||
i == j, i < j )));
|
i == j, i < j )));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,14 +15,14 @@
|
|||||||
// template<class charT, class traits>
|
// template<class charT, class traits>
|
||||||
// basic_ostream<charT, traits>&
|
// basic_ostream<charT, traits>&
|
||||||
// operator<<(basic_ostream<charT, traits>& os, const month_day& md);
|
// operator<<(basic_ostream<charT, traits>& os, const month_day& md);
|
||||||
//
|
//
|
||||||
// Returns: os << md.month() << '/' << md.day().
|
// Returns: os << md.month() << '/' << md.day().
|
||||||
//
|
//
|
||||||
// template<class charT, class traits>
|
// template<class charT, class traits>
|
||||||
// basic_ostream<charT, traits>&
|
// basic_ostream<charT, traits>&
|
||||||
// to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const month_day& md);
|
// to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const month_day& md);
|
||||||
//
|
//
|
||||||
// Effects: Streams md into os using the format specified by the NTCTS fmt.
|
// Effects: Streams md into os using the format specified by the NTCTS fmt.
|
||||||
// fmt encoding follows the rules specified in 25.11.
|
// fmt encoding follows the rules specified in 25.11.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
using month_day = std::chrono::month_day;
|
using month_day = std::chrono::month_day;
|
||||||
|
|
||||||
static_assert(std::is_trivially_copyable_v<month_day>, "");
|
static_assert(std::is_trivially_copyable_v<month_day>, "");
|
||||||
static_assert(std::is_standard_layout_v<month_day>, "");
|
static_assert(std::is_standard_layout_v<month_day>, "");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ int main()
|
|||||||
|
|
||||||
AssertComparisons6AreNoexcept<month_day_last>();
|
AssertComparisons6AreNoexcept<month_day_last>();
|
||||||
AssertComparisons6ReturnBool<month_day_last>();
|
AssertComparisons6ReturnBool<month_day_last>();
|
||||||
|
|
||||||
static_assert( testComparisons6Values<month_day_last>(month{1}, month{1}), "");
|
static_assert( testComparisons6Values<month_day_last>(month{1}, month{1}), "");
|
||||||
static_assert( testComparisons6Values<month_day_last>(month{1}, month{2}), "");
|
static_assert( testComparisons6Values<month_day_last>(month{1}, month{2}), "");
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
//
|
//
|
||||||
// constexpr chrono::month month() const noexcept;
|
// constexpr chrono::month month() const noexcept;
|
||||||
// constexpr bool ok() const noexcept;
|
// constexpr bool ok() const noexcept;
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@@ -30,7 +30,7 @@ int main()
|
|||||||
using month_day_last = std::chrono::month_day_last;
|
using month_day_last = std::chrono::month_day_last;
|
||||||
|
|
||||||
ASSERT_NOEXCEPT(month_day_last{month{1}});
|
ASSERT_NOEXCEPT(month_day_last{month{1}});
|
||||||
|
|
||||||
constexpr month_day_last md0{month{}};
|
constexpr month_day_last md0{month{}};
|
||||||
static_assert( md0.month() == month{}, "");
|
static_assert( md0.month() == month{}, "");
|
||||||
static_assert(!md0.ok(), "");
|
static_assert(!md0.ok(), "");
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
// template<class charT, class traits>
|
// template<class charT, class traits>
|
||||||
// basic_ostream<charT, traits>&
|
// basic_ostream<charT, traits>&
|
||||||
// operator<<(basic_ostream<charT, traits>& os, const month_day_last& mdl);
|
// operator<<(basic_ostream<charT, traits>& os, const month_day_last& mdl);
|
||||||
//
|
//
|
||||||
// Returns: os << mdl.month() << "/last".
|
// Returns: os << mdl.month() << "/last".
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
using month_day_last = std::chrono::month_day_last;
|
using month_day_last = std::chrono::month_day_last;
|
||||||
|
|
||||||
static_assert(std::is_trivially_copyable_v<month_day_last>, "");
|
static_assert(std::is_trivially_copyable_v<month_day_last>, "");
|
||||||
static_assert(std::is_standard_layout_v<month_day_last>, "");
|
static_assert(std::is_standard_layout_v<month_day_last>, "");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,13 +31,13 @@ int main()
|
|||||||
ASSERT_NOEXCEPT(month{});
|
ASSERT_NOEXCEPT(month{});
|
||||||
ASSERT_NOEXCEPT(month(1));
|
ASSERT_NOEXCEPT(month(1));
|
||||||
ASSERT_NOEXCEPT(static_cast<unsigned>(month(1)));
|
ASSERT_NOEXCEPT(static_cast<unsigned>(month(1)));
|
||||||
|
|
||||||
constexpr month m0{};
|
constexpr month m0{};
|
||||||
static_assert(static_cast<unsigned>(m0) == 0, "");
|
static_assert(static_cast<unsigned>(m0) == 0, "");
|
||||||
|
|
||||||
constexpr month m1{1};
|
constexpr month m1{1};
|
||||||
static_assert(static_cast<unsigned>(m1) == 1, "");
|
static_assert(static_cast<unsigned>(m1) == 1, "");
|
||||||
|
|
||||||
for (unsigned i = 0; i <= 255; ++i)
|
for (unsigned i = 0; i <= 255; ++i)
|
||||||
{
|
{
|
||||||
month m(i);
|
month m(i);
|
||||||
|
|||||||
@@ -34,13 +34,13 @@ constexpr bool testConstexpr()
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
using month = std::chrono::month;
|
using month = std::chrono::month;
|
||||||
|
|
||||||
ASSERT_NOEXCEPT(--(std::declval<month&>()) );
|
ASSERT_NOEXCEPT(--(std::declval<month&>()) );
|
||||||
ASSERT_NOEXCEPT( (std::declval<month&>())--);
|
ASSERT_NOEXCEPT( (std::declval<month&>())--);
|
||||||
|
|
||||||
ASSERT_SAME_TYPE(month , decltype( std::declval<month&>()--));
|
ASSERT_SAME_TYPE(month , decltype( std::declval<month&>()--));
|
||||||
ASSERT_SAME_TYPE(month&, decltype(--std::declval<month&>() ));
|
ASSERT_SAME_TYPE(month&, decltype(--std::declval<month&>() ));
|
||||||
|
|
||||||
static_assert(testConstexpr<month>(), "");
|
static_assert(testConstexpr<month>(), "");
|
||||||
|
|
||||||
for (unsigned i = 10; i <= 20; ++i)
|
for (unsigned i = 10; i <= 20; ++i)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ int main()
|
|||||||
|
|
||||||
ASSERT_SAME_TYPE(month , decltype( std::declval<month&>()++));
|
ASSERT_SAME_TYPE(month , decltype( std::declval<month&>()++));
|
||||||
ASSERT_SAME_TYPE(month&, decltype(++std::declval<month&>() ));
|
ASSERT_SAME_TYPE(month&, decltype(++std::declval<month&>() ));
|
||||||
|
|
||||||
static_assert(testConstexpr<month>(), "");
|
static_assert(testConstexpr<month>(), "");
|
||||||
|
|
||||||
for (unsigned i = 0; i <= 10; ++i)
|
for (unsigned i = 0; i <= 10; ++i)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ int main()
|
|||||||
ASSERT_NOEXCEPT(std::declval<month&>() -= std::declval<months&>());
|
ASSERT_NOEXCEPT(std::declval<month&>() -= std::declval<months&>());
|
||||||
ASSERT_SAME_TYPE(month&, decltype(std::declval<month&>() += std::declval<months&>()));
|
ASSERT_SAME_TYPE(month&, decltype(std::declval<month&>() += std::declval<months&>()));
|
||||||
ASSERT_SAME_TYPE(month&, decltype(std::declval<month&>() -= std::declval<months&>()));
|
ASSERT_SAME_TYPE(month&, decltype(std::declval<month&>() -= std::declval<months&>()));
|
||||||
|
|
||||||
static_assert(testConstexpr<month, months>(), "");
|
static_assert(testConstexpr<month, months>(), "");
|
||||||
|
|
||||||
for (unsigned i = 1; i <= 10; ++i)
|
for (unsigned i = 1; i <= 10; ++i)
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ int main()
|
|||||||
|
|
||||||
static_assert(testComparisons6Values<month>(0U ,0U), "");
|
static_assert(testComparisons6Values<month>(0U ,0U), "");
|
||||||
static_assert(testComparisons6Values<month>(0U, 1U), "");
|
static_assert(testComparisons6Values<month>(0U, 1U), "");
|
||||||
|
|
||||||
// Some 'ok' values as well
|
// Some 'ok' values as well
|
||||||
static_assert(testComparisons6Values<month>( 5U, 5U), "");
|
static_assert(testComparisons6Values<month>( 5U, 5U), "");
|
||||||
static_assert(testComparisons6Values<month>( 5U, 10U), "");
|
static_assert(testComparisons6Values<month>( 5U, 10U), "");
|
||||||
|
|
||||||
for (unsigned i = 1; i < 10; ++i)
|
for (unsigned i = 1; i < 10; ++i)
|
||||||
for (unsigned j = 10; j < 10; ++j)
|
for (unsigned j = 10; j < 10; ++j)
|
||||||
assert(testComparisons6Values<month>(i, j));
|
assert(testComparisons6Values<month>(i, j));
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
// Returns: x + -y.
|
// Returns: x + -y.
|
||||||
//
|
//
|
||||||
// constexpr months operator-(const month& x, const month& y) noexcept;
|
// constexpr months operator-(const month& x, const month& y) noexcept;
|
||||||
// Returns: If x.ok() == true and y.ok() == true, returns a value m in the range
|
// Returns: If x.ok() == true and y.ok() == true, returns a value m in the range
|
||||||
// [months{0}, months{11}] satisfying y + m == x.
|
// [months{0}, months{11}] satisfying y + m == x.
|
||||||
// Otherwise the value returned is unspecified.
|
// Otherwise the value returned is unspecified.
|
||||||
// [Example: January - February == months{11}. —end example]
|
// [Example: January - February == months{11}. —end example]
|
||||||
|
|
||||||
extern "C" int printf(const char *, ...);
|
extern "C" int printf(const char *, ...);
|
||||||
@@ -55,7 +55,7 @@ int main()
|
|||||||
|
|
||||||
ASSERT_SAME_TYPE(month , decltype(std::declval<month>() - std::declval<months>()));
|
ASSERT_SAME_TYPE(month , decltype(std::declval<month>() - std::declval<months>()));
|
||||||
ASSERT_SAME_TYPE(months, decltype(std::declval<month>() - std::declval<month> ()));
|
ASSERT_SAME_TYPE(months, decltype(std::declval<month>() - std::declval<month> ()));
|
||||||
|
|
||||||
static_assert(testConstexpr<month, months>(), "");
|
static_assert(testConstexpr<month, months>(), "");
|
||||||
|
|
||||||
month m{6};
|
month m{6};
|
||||||
|
|||||||
@@ -17,9 +17,9 @@
|
|||||||
// constexpr month operator+(const months& x, const month& y) noexcept;
|
// constexpr month operator+(const months& x, const month& y) noexcept;
|
||||||
// Returns:
|
// Returns:
|
||||||
// month{modulo(static_cast<long long>(int{x}) + (y.count() - 1), 12) + 1}
|
// month{modulo(static_cast<long long>(int{x}) + (y.count() - 1), 12) + 1}
|
||||||
// where modulo(n, 12) computes the remainder of n divided by 12 using Euclidean division.
|
// where modulo(n, 12) computes the remainder of n divided by 12 using Euclidean division.
|
||||||
// [Note: Given a divisor of 12, Euclidean division truncates towards negative infinity
|
// [Note: Given a divisor of 12, Euclidean division truncates towards negative infinity
|
||||||
// and always produces a remainder in the range of [0, 11].
|
// and always produces a remainder in the range of [0, 11].
|
||||||
// Assuming no overflow in the signed summation, this operation results in a month
|
// Assuming no overflow in the signed summation, this operation results in a month
|
||||||
// holding a value in the range [1, 12] even if !x.ok(). —end note]
|
// holding a value in the range [1, 12] even if !x.ok(). —end note]
|
||||||
// [Example: February + months{11} == January. —end example]
|
// [Example: February + months{11} == January. —end example]
|
||||||
@@ -54,7 +54,7 @@ int main()
|
|||||||
|
|
||||||
ASSERT_SAME_TYPE(month, decltype(std::declval<month>() + std::declval<months>()));
|
ASSERT_SAME_TYPE(month, decltype(std::declval<month>() + std::declval<months>()));
|
||||||
ASSERT_SAME_TYPE(month, decltype(std::declval<months>() + std::declval<month>() ));
|
ASSERT_SAME_TYPE(month, decltype(std::declval<months>() + std::declval<month>() ));
|
||||||
|
|
||||||
static_assert(testConstexpr<month, months>(), "");
|
static_assert(testConstexpr<month, months>(), "");
|
||||||
|
|
||||||
month my{2};
|
month my{2};
|
||||||
|
|||||||
@@ -15,28 +15,28 @@
|
|||||||
// template<class charT, class traits>
|
// template<class charT, class traits>
|
||||||
// basic_ostream<charT, traits>&
|
// basic_ostream<charT, traits>&
|
||||||
// operator<<(basic_ostream<charT, traits>& os, const month& m);
|
// operator<<(basic_ostream<charT, traits>& os, const month& m);
|
||||||
//
|
//
|
||||||
// Effects: If m.ok() == true inserts format(os.getloc(), fmt, m) where fmt is "%b" widened to charT.
|
// Effects: If m.ok() == true inserts format(os.getloc(), fmt, m) where fmt is "%b" widened to charT.
|
||||||
// Otherwise inserts int{m} << " is not a valid month".
|
// Otherwise inserts int{m} << " is not a valid month".
|
||||||
//
|
//
|
||||||
// template<class charT, class traits>
|
// template<class charT, class traits>
|
||||||
// basic_ostream<charT, traits>&
|
// basic_ostream<charT, traits>&
|
||||||
// to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const month& m);
|
// to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const month& m);
|
||||||
//
|
//
|
||||||
// Effects: Streams m into os using the format specified by the NTCTS fmt.
|
// Effects: Streams m into os using the format specified by the NTCTS fmt.
|
||||||
// fmt encoding follows the rules specified in 25.11.
|
// fmt encoding follows the rules specified in 25.11.
|
||||||
//
|
//
|
||||||
// template<class charT, class traits, class Alloc = allocator<charT>>
|
// template<class charT, class traits, class Alloc = allocator<charT>>
|
||||||
// basic_istream<charT, traits>&
|
// basic_istream<charT, traits>&
|
||||||
// from_stream(basic_istream<charT, traits>& is, const charT* fmt,
|
// from_stream(basic_istream<charT, traits>& is, const charT* fmt,
|
||||||
// month& m, basic_string<charT, traits, Alloc>* abbrev = nullptr,
|
// month& m, basic_string<charT, traits, Alloc>* abbrev = nullptr,
|
||||||
// minutes* offset = nullptr);
|
// minutes* offset = nullptr);
|
||||||
//
|
//
|
||||||
// Effects: Attempts to parse the input stream is into the month m using the format flags
|
// Effects: Attempts to parse the input stream is into the month m using the format flags
|
||||||
// given in the NTCTS fmt as specified in 25.12. If the parse fails to decode a valid month,
|
// given in the NTCTS fmt as specified in 25.12. If the parse fails to decode a valid month,
|
||||||
// is.setstate(ios_- base::failbit) shall be called and m shall not be modified.
|
// is.setstate(ios_- base::failbit) shall be called and m shall not be modified.
|
||||||
// If %Z is used and successfully parsed, that value will be assigned to *abbrev if
|
// If %Z is used and successfully parsed, that value will be assigned to *abbrev if
|
||||||
// abbrev is non-null. If %z (or a modified variant) is used and successfully parsed,
|
// abbrev is non-null. If %z (or a modified variant) is used and successfully parsed,
|
||||||
// that value will be assigned to *offset if offset is non-null.
|
// that value will be assigned to *offset if offset is non-null.
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
using month = std::chrono::month;
|
using month = std::chrono::month;
|
||||||
|
|
||||||
static_assert(std::is_trivially_copyable_v<month>, "");
|
static_assert(std::is_trivially_copyable_v<month>, "");
|
||||||
static_assert(std::is_standard_layout_v<month>, "");
|
static_assert(std::is_standard_layout_v<month>, "");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
// constexpr chrono::month month() const noexcept;
|
// constexpr chrono::month month() const noexcept;
|
||||||
// constexpr chrono::weekday_indexed weekday_indexed() const noexcept;
|
// constexpr chrono::weekday_indexed weekday_indexed() const noexcept;
|
||||||
// constexpr bool ok() const noexcept;
|
// constexpr bool ok() const noexcept;
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@@ -33,7 +33,7 @@ int main()
|
|||||||
using weekday_indexed = std::chrono::weekday_indexed;
|
using weekday_indexed = std::chrono::weekday_indexed;
|
||||||
|
|
||||||
ASSERT_NOEXCEPT(month_weekday{month{1}, weekday_indexed{weekday{}, 1}});
|
ASSERT_NOEXCEPT(month_weekday{month{1}, weekday_indexed{weekday{}, 1}});
|
||||||
|
|
||||||
constexpr month_weekday md0{month{}, weekday_indexed{}};
|
constexpr month_weekday md0{month{}, weekday_indexed{}};
|
||||||
static_assert( md0.month() == month{}, "");
|
static_assert( md0.month() == month{}, "");
|
||||||
static_assert( md0.weekday_indexed() == weekday_indexed{}, "");
|
static_assert( md0.weekday_indexed() == weekday_indexed{}, "");
|
||||||
|
|||||||
@@ -34,12 +34,12 @@ int main()
|
|||||||
|
|
||||||
AssertComparisons2AreNoexcept<month_weekday>();
|
AssertComparisons2AreNoexcept<month_weekday>();
|
||||||
AssertComparisons2ReturnBool<month_weekday>();
|
AssertComparisons2ReturnBool<month_weekday>();
|
||||||
|
|
||||||
static_assert( testComparisons2(
|
static_assert( testComparisons2(
|
||||||
month_weekday{std::chrono::January, weekday_indexed{Sunday, 1}},
|
month_weekday{std::chrono::January, weekday_indexed{Sunday, 1}},
|
||||||
month_weekday{std::chrono::January, weekday_indexed{Sunday, 1}},
|
month_weekday{std::chrono::January, weekday_indexed{Sunday, 1}},
|
||||||
true), "");
|
true), "");
|
||||||
|
|
||||||
static_assert( testComparisons2(
|
static_assert( testComparisons2(
|
||||||
month_weekday{std::chrono::January, weekday_indexed{Sunday, 1}},
|
month_weekday{std::chrono::January, weekday_indexed{Sunday, 1}},
|
||||||
month_weekday{std::chrono::January, weekday_indexed{Sunday, 2}},
|
month_weekday{std::chrono::January, weekday_indexed{Sunday, 2}},
|
||||||
@@ -64,23 +64,23 @@ int main()
|
|||||||
for (unsigned i = 1; i < 12; ++i)
|
for (unsigned i = 1; i < 12; ++i)
|
||||||
for (unsigned j = 1; j < 12; ++j)
|
for (unsigned j = 1; j < 12; ++j)
|
||||||
assert((testComparisons2(
|
assert((testComparisons2(
|
||||||
month_weekday{month{i}, weekday_indexed{Sunday, 1}},
|
month_weekday{month{i}, weekday_indexed{Sunday, 1}},
|
||||||
month_weekday{month{j}, weekday_indexed{Sunday, 1}},
|
month_weekday{month{j}, weekday_indexed{Sunday, 1}},
|
||||||
i == j)));
|
i == j)));
|
||||||
|
|
||||||
// same month, different weeks
|
// same month, different weeks
|
||||||
for (unsigned i = 1; i < 5; ++i)
|
for (unsigned i = 1; i < 5; ++i)
|
||||||
for (unsigned j = 1; j < 5; ++j)
|
for (unsigned j = 1; j < 5; ++j)
|
||||||
assert((testComparisons2(
|
assert((testComparisons2(
|
||||||
month_weekday{month{2}, weekday_indexed{Sunday, i}},
|
month_weekday{month{2}, weekday_indexed{Sunday, i}},
|
||||||
month_weekday{month{2}, weekday_indexed{Sunday, j}},
|
month_weekday{month{2}, weekday_indexed{Sunday, j}},
|
||||||
i == j)));
|
i == j)));
|
||||||
|
|
||||||
// same month, different days
|
// same month, different days
|
||||||
for (unsigned i = 0; i < 6; ++i)
|
for (unsigned i = 0; i < 6; ++i)
|
||||||
for (unsigned j = 0; j < 6; ++j)
|
for (unsigned j = 0; j < 6; ++j)
|
||||||
assert((testComparisons2(
|
assert((testComparisons2(
|
||||||
month_weekday{month{2}, weekday_indexed{weekday{i}, 2}},
|
month_weekday{month{2}, weekday_indexed{weekday{i}, 2}},
|
||||||
month_weekday{month{2}, weekday_indexed{weekday{j}, 2}},
|
month_weekday{month{2}, weekday_indexed{weekday{j}, 2}},
|
||||||
i == j)));
|
i == j)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
// template<class charT, class traits>
|
// template<class charT, class traits>
|
||||||
// basic_ostream<charT, traits>&
|
// basic_ostream<charT, traits>&
|
||||||
// operator<<(basic_ostream<charT, traits>& os, const month_weekday& mwd);
|
// operator<<(basic_ostream<charT, traits>& os, const month_weekday& mwd);
|
||||||
//
|
//
|
||||||
// Returns: os << mwd.month() << '/' << mwd.weekday_indexed().
|
// Returns: os << mwd.month() << '/' << mwd.weekday_indexed().
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@@ -31,6 +31,6 @@ int main()
|
|||||||
using month = std::chrono::month;
|
using month = std::chrono::month;
|
||||||
using weekday_indexed = std::chrono::weekday_indexed;
|
using weekday_indexed = std::chrono::weekday_indexed;
|
||||||
using weekday = std::chrono::weekday;
|
using weekday = std::chrono::weekday;
|
||||||
|
|
||||||
std::cout << month_weekday{month{1}, weekday_indexed{weekday{3}, 3}};
|
std::cout << month_weekday{month{1}, weekday_indexed{weekday{3}, 3}};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
using month_weekday = std::chrono::month_weekday;
|
using month_weekday = std::chrono::month_weekday;
|
||||||
|
|
||||||
static_assert(std::is_trivially_copyable_v<month_weekday>, "");
|
static_assert(std::is_trivially_copyable_v<month_weekday>, "");
|
||||||
static_assert(std::is_standard_layout_v<month_weekday>, "");
|
static_assert(std::is_standard_layout_v<month_weekday>, "");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
// constexpr chrono::month month() const noexcept;
|
// constexpr chrono::month month() const noexcept;
|
||||||
// constexpr chrono::weekday_last weekday_last() const noexcept;
|
// constexpr chrono::weekday_last weekday_last() const noexcept;
|
||||||
// constexpr bool ok() const noexcept;
|
// constexpr bool ok() const noexcept;
|
||||||
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@@ -39,7 +39,7 @@ int main()
|
|||||||
constexpr weekday Tuesday = std::chrono::Tuesday;
|
constexpr weekday Tuesday = std::chrono::Tuesday;
|
||||||
|
|
||||||
ASSERT_NOEXCEPT(month_weekday_last{January, weekday_last{Tuesday}});
|
ASSERT_NOEXCEPT(month_weekday_last{January, weekday_last{Tuesday}});
|
||||||
|
|
||||||
// bad month
|
// bad month
|
||||||
constexpr month_weekday_last mwdl1{month{}, weekday_last{Tuesday}};
|
constexpr month_weekday_last mwdl1{month{}, weekday_last{Tuesday}};
|
||||||
static_assert( mwdl1.month() == month{}, "");
|
static_assert( mwdl1.month() == month{}, "");
|
||||||
|
|||||||
@@ -40,12 +40,12 @@ int main()
|
|||||||
AssertComparisons2ReturnBool<month_weekday_last>();
|
AssertComparisons2ReturnBool<month_weekday_last>();
|
||||||
|
|
||||||
static_assert( testComparisons2(
|
static_assert( testComparisons2(
|
||||||
month_weekday_last{std::chrono::January, weekday_last{Tuesday}},
|
month_weekday_last{std::chrono::January, weekday_last{Tuesday}},
|
||||||
month_weekday_last{std::chrono::January, weekday_last{Tuesday}},
|
month_weekday_last{std::chrono::January, weekday_last{Tuesday}},
|
||||||
true), "");
|
true), "");
|
||||||
|
|
||||||
static_assert( testComparisons2(
|
static_assert( testComparisons2(
|
||||||
month_weekday_last{std::chrono::January, weekday_last{Tuesday}},
|
month_weekday_last{std::chrono::January, weekday_last{Tuesday}},
|
||||||
month_weekday_last{std::chrono::January, weekday_last{Wednesday}},
|
month_weekday_last{std::chrono::January, weekday_last{Wednesday}},
|
||||||
false), "");
|
false), "");
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
// template<class charT, class traits>
|
// template<class charT, class traits>
|
||||||
// basic_ostream<charT, traits>&
|
// basic_ostream<charT, traits>&
|
||||||
// operator<<(basic_ostream<charT, traits>& os, const month_weekday_last& mdl);
|
// operator<<(basic_ostream<charT, traits>& os, const month_weekday_last& mdl);
|
||||||
//
|
//
|
||||||
// Returns: os << mdl.month() << "/last".
|
// Returns: os << mdl.month() << "/last".
|
||||||
|
|
||||||
|
|
||||||
@@ -32,6 +32,6 @@ int main()
|
|||||||
using month = std::chrono::month;
|
using month = std::chrono::month;
|
||||||
using weekday = std::chrono::weekday;
|
using weekday = std::chrono::weekday;
|
||||||
using weekday_last = std::chrono::weekday_last;
|
using weekday_last = std::chrono::weekday_last;
|
||||||
|
|
||||||
std::cout << month_weekday_last{month{1}, weekday_last{weekday{3}}};
|
std::cout << month_weekday_last{month{1}, weekday_last{weekday{3}}};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
using month_weekday_last = std::chrono::month_weekday_last;
|
using month_weekday_last = std::chrono::month_weekday_last;
|
||||||
|
|
||||||
static_assert(std::is_trivially_copyable_v<month_weekday_last>, "");
|
static_assert(std::is_trivially_copyable_v<month_weekday_last>, "");
|
||||||
static_assert(std::is_standard_layout_v<month_weekday_last>, "");
|
static_assert(std::is_standard_layout_v<month_weekday_last>, "");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,19 +14,19 @@
|
|||||||
// constexpr month_day
|
// constexpr month_day
|
||||||
// operator/(const month& m, const day& d) noexcept;
|
// operator/(const month& m, const day& d) noexcept;
|
||||||
// Returns: {m, d}.
|
// Returns: {m, d}.
|
||||||
//
|
//
|
||||||
// constexpr month_day
|
// constexpr month_day
|
||||||
// operator/(const day& d, const month& m) noexcept;
|
// operator/(const day& d, const month& m) noexcept;
|
||||||
// Returns: m / d.
|
// Returns: m / d.
|
||||||
|
|
||||||
// constexpr month_day
|
// constexpr month_day
|
||||||
// operator/(const month& m, int d) noexcept;
|
// operator/(const month& m, int d) noexcept;
|
||||||
// Returns: m / day(d).
|
// Returns: m / day(d).
|
||||||
//
|
//
|
||||||
// constexpr month_day
|
// constexpr month_day
|
||||||
// operator/(int m, const day& d) noexcept;
|
// operator/(int m, const day& d) noexcept;
|
||||||
// Returns: month(m) / d.
|
// Returns: month(m) / d.
|
||||||
//
|
//
|
||||||
// constexpr month_day
|
// constexpr month_day
|
||||||
// operator/(const day& d, int m) noexcept;
|
// operator/(const day& d, int m) noexcept;
|
||||||
// Returns: month(m) / d.
|
// Returns: month(m) / d.
|
||||||
@@ -46,7 +46,7 @@ int main()
|
|||||||
using day = std::chrono::day;
|
using day = std::chrono::day;
|
||||||
|
|
||||||
constexpr month February = std::chrono::February;
|
constexpr month February = std::chrono::February;
|
||||||
|
|
||||||
{ // operator/(const month& m, const day& d) (and switched)
|
{ // operator/(const month& m, const day& d) (and switched)
|
||||||
ASSERT_NOEXCEPT ( February/day{1});
|
ASSERT_NOEXCEPT ( February/day{1});
|
||||||
ASSERT_SAME_TYPE(month_day, decltype(February/day{1}));
|
ASSERT_SAME_TYPE(month_day, decltype(February/day{1}));
|
||||||
|
|||||||
@@ -14,15 +14,15 @@
|
|||||||
// constexpr month_day_last
|
// constexpr month_day_last
|
||||||
// operator/(const month& m, last_spec) noexcept;
|
// operator/(const month& m, last_spec) noexcept;
|
||||||
// Returns: month_day_last{m}.
|
// Returns: month_day_last{m}.
|
||||||
//
|
//
|
||||||
// constexpr month_day_last
|
// constexpr month_day_last
|
||||||
// operator/(int m, last_spec) noexcept;
|
// operator/(int m, last_spec) noexcept;
|
||||||
// Returns: month(m) / last.
|
// Returns: month(m) / last.
|
||||||
//
|
//
|
||||||
// constexpr month_day_last
|
// constexpr month_day_last
|
||||||
// operator/(last_spec, const month& m) noexcept;
|
// operator/(last_spec, const month& m) noexcept;
|
||||||
// Returns: m / last.
|
// Returns: m / last.
|
||||||
//
|
//
|
||||||
// constexpr month_day_last
|
// constexpr month_day_last
|
||||||
// operator/(last_spec, int m) noexcept;
|
// operator/(last_spec, int m) noexcept;
|
||||||
// Returns: month(m) / last.
|
// Returns: month(m) / last.
|
||||||
@@ -51,7 +51,7 @@ int main()
|
|||||||
{
|
{
|
||||||
using month = std::chrono::month;
|
using month = std::chrono::month;
|
||||||
using month_day_last = std::chrono::month_day_last;
|
using month_day_last = std::chrono::month_day_last;
|
||||||
|
|
||||||
constexpr month February = std::chrono::February;
|
constexpr month February = std::chrono::February;
|
||||||
constexpr std::chrono::last_spec last = std::chrono::last;
|
constexpr std::chrono::last_spec last = std::chrono::last;
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ int main()
|
|||||||
constexpr auto mdl = February/std::chrono::last;
|
constexpr auto mdl = February/std::chrono::last;
|
||||||
static_assert(mdl.month() == February, "");
|
static_assert(mdl.month() == February, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // operator/(const month& m, last_spec) and switched
|
{ // operator/(const month& m, last_spec) and switched
|
||||||
ASSERT_NOEXCEPT ( last/February);
|
ASSERT_NOEXCEPT ( last/February);
|
||||||
ASSERT_SAME_TYPE(month_day_last, decltype(last/February));
|
ASSERT_SAME_TYPE(month_day_last, decltype(last/February));
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ int main()
|
|||||||
|
|
||||||
constexpr weekday Tuesday = std::chrono::Tuesday;
|
constexpr weekday Tuesday = std::chrono::Tuesday;
|
||||||
constexpr month February = std::chrono::February;
|
constexpr month February = std::chrono::February;
|
||||||
|
|
||||||
{ // operator/(const month& m, const weekday_indexed& wdi) (and switched)
|
{ // operator/(const month& m, const weekday_indexed& wdi) (and switched)
|
||||||
ASSERT_NOEXCEPT (February/Tuesday[2]);
|
ASSERT_NOEXCEPT (February/Tuesday[2]);
|
||||||
ASSERT_SAME_TYPE(month_weekday, decltype(February/Tuesday[2]));
|
ASSERT_SAME_TYPE(month_weekday, decltype(February/Tuesday[2]));
|
||||||
@@ -67,7 +67,7 @@ int main()
|
|||||||
static_assert(wdi.month() == February, "");
|
static_assert(wdi.month() == February, "");
|
||||||
static_assert(wdi.weekday_indexed() == Tuesday[3], "");
|
static_assert(wdi.weekday_indexed() == Tuesday[3], "");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 1; i <= 12; ++i)
|
for (int i = 1; i <= 12; ++i)
|
||||||
for (unsigned j = 0; j <= 6; ++j)
|
for (unsigned j = 0; j <= 6; ++j)
|
||||||
for (unsigned k = 1; k <= 5; ++k)
|
for (unsigned k = 1; k <= 5; ++k)
|
||||||
@@ -82,7 +82,7 @@ int main()
|
|||||||
assert(mwd2.weekday_indexed() == wdi);
|
assert(mwd2.weekday_indexed() == wdi);
|
||||||
assert(mwd1 == mwd2);
|
assert(mwd1 == mwd2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
{ // operator/(int m, const weekday_indexed& wdi) (and switched)
|
{ // operator/(int m, const weekday_indexed& wdi) (and switched)
|
||||||
@@ -97,7 +97,7 @@ int main()
|
|||||||
static_assert(wdi.month() == February, "");
|
static_assert(wdi.month() == February, "");
|
||||||
static_assert(wdi.weekday_indexed() == Tuesday[3], "");
|
static_assert(wdi.weekday_indexed() == Tuesday[3], "");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 1; i <= 12; ++i)
|
for (int i = 1; i <= 12; ++i)
|
||||||
for (unsigned j = 0; j <= 6; ++j)
|
for (unsigned j = 0; j <= 6; ++j)
|
||||||
for (unsigned k = 1; k <= 5; ++k)
|
for (unsigned k = 1; k <= 5; ++k)
|
||||||
@@ -111,5 +111,5 @@ int main()
|
|||||||
assert(mwd2.weekday_indexed() == wdi);
|
assert(mwd2.weekday_indexed() == wdi);
|
||||||
assert(mwd1 == mwd2);
|
assert(mwd1 == mwd2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,15 +14,15 @@
|
|||||||
// constexpr month_weekday_last
|
// constexpr month_weekday_last
|
||||||
// operator/(const month& m, const weekday_last& wdl) noexcept;
|
// operator/(const month& m, const weekday_last& wdl) noexcept;
|
||||||
// Returns: {m, wdl}.
|
// Returns: {m, wdl}.
|
||||||
//
|
//
|
||||||
// constexpr month_weekday_last
|
// constexpr month_weekday_last
|
||||||
// operator/(int m, const weekday_last& wdl) noexcept;
|
// operator/(int m, const weekday_last& wdl) noexcept;
|
||||||
// Returns: month(m) / wdl.
|
// Returns: month(m) / wdl.
|
||||||
//
|
//
|
||||||
// constexpr month_weekday_last
|
// constexpr month_weekday_last
|
||||||
// operator/(const weekday_last& wdl, const month& m) noexcept;
|
// operator/(const weekday_last& wdl, const month& m) noexcept;
|
||||||
// Returns: m / wdl.
|
// Returns: m / wdl.
|
||||||
//
|
//
|
||||||
// constexpr month_weekday_last
|
// constexpr month_weekday_last
|
||||||
// operator/(const weekday_last& wdl, int m) noexcept;
|
// operator/(const weekday_last& wdl, int m) noexcept;
|
||||||
// Returns: month(m) / wdl.
|
// Returns: month(m) / wdl.
|
||||||
@@ -48,7 +48,7 @@ int main()
|
|||||||
constexpr weekday Tuesday = std::chrono::Tuesday;
|
constexpr weekday Tuesday = std::chrono::Tuesday;
|
||||||
constexpr month February = std::chrono::February;
|
constexpr month February = std::chrono::February;
|
||||||
constexpr std::chrono::last_spec last = std::chrono::last;
|
constexpr std::chrono::last_spec last = std::chrono::last;
|
||||||
|
|
||||||
{ // operator/(const month& m, const weekday_last& wdi) (and switched)
|
{ // operator/(const month& m, const weekday_last& wdi) (and switched)
|
||||||
ASSERT_NOEXCEPT (February/Tuesday[last]);
|
ASSERT_NOEXCEPT (February/Tuesday[last]);
|
||||||
ASSERT_SAME_TYPE(month_weekday_last, decltype(February/Tuesday[last]));
|
ASSERT_SAME_TYPE(month_weekday_last, decltype(February/Tuesday[last]));
|
||||||
@@ -61,7 +61,7 @@ int main()
|
|||||||
static_assert(wdi.month() == February, "");
|
static_assert(wdi.month() == February, "");
|
||||||
static_assert(wdi.weekday_last() == Tuesday[last], "");
|
static_assert(wdi.weekday_last() == Tuesday[last], "");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 1; i <= 12; ++i)
|
for (int i = 1; i <= 12; ++i)
|
||||||
for (unsigned j = 0; j <= 6; ++j)
|
for (unsigned j = 0; j <= 6; ++j)
|
||||||
{
|
{
|
||||||
@@ -90,7 +90,7 @@ int main()
|
|||||||
static_assert(wdi.month() == February, "");
|
static_assert(wdi.month() == February, "");
|
||||||
static_assert(wdi.weekday_indexed() == Tuesday[3], "");
|
static_assert(wdi.weekday_indexed() == Tuesday[3], "");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 1; i <= 12; ++i)
|
for (int i = 1; i <= 12; ++i)
|
||||||
for (unsigned j = 0; j <= 6; ++j)
|
for (unsigned j = 0; j <= 6; ++j)
|
||||||
{
|
{
|
||||||
@@ -103,5 +103,5 @@ int main()
|
|||||||
assert(mwd2.weekday_last() == wdi);
|
assert(mwd2.weekday_last() == wdi);
|
||||||
assert(mwd1 == mwd2);
|
assert(mwd1 == mwd2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
// constexpr year_month operator/(const year& y, const month& m) noexcept;
|
// constexpr year_month operator/(const year& y, const month& m) noexcept;
|
||||||
// Returns: {y, m}.
|
// Returns: {y, m}.
|
||||||
//
|
//
|
||||||
// constexpr year_month operator/(const year& y, int m) noexcept;
|
// constexpr year_month operator/(const year& y, int m) noexcept;
|
||||||
// Returns: y / month(m).
|
// Returns: y / month(m).
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ int main()
|
|||||||
|
|
||||||
static_assert((year{2018}/2).year() == year{2018}, "");
|
static_assert((year{2018}/2).year() == year{2018}, "");
|
||||||
static_assert((year{2018}/2).month() == month{2}, "");
|
static_assert((year{2018}/2).month() == month{2}, "");
|
||||||
|
|
||||||
for (int i = 1000; i <= 1030; ++i)
|
for (int i = 1000; i <= 1030; ++i)
|
||||||
for (unsigned j = 1; j <= 12; ++j)
|
for (unsigned j = 1; j <= 12; ++j)
|
||||||
{
|
{
|
||||||
@@ -64,5 +64,5 @@ int main()
|
|||||||
assert(static_cast<int>(ym.year()) == i);
|
assert(static_cast<int>(ym.year()) == i);
|
||||||
assert(static_cast<unsigned>(ym.month()) == j);
|
assert(static_cast<unsigned>(ym.month()) == j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,23 +14,23 @@
|
|||||||
// constexpr year_month_day
|
// constexpr year_month_day
|
||||||
// operator/(const year_month& ym, const day& d) noexcept;
|
// operator/(const year_month& ym, const day& d) noexcept;
|
||||||
// Returns: {ym.year(), ym.month(), d}.
|
// Returns: {ym.year(), ym.month(), d}.
|
||||||
//
|
//
|
||||||
// constexpr year_month_day
|
// constexpr year_month_day
|
||||||
// operator/(const year_month& ym, int d) noexcept;
|
// operator/(const year_month& ym, int d) noexcept;
|
||||||
// Returns: ym / day(d).
|
// Returns: ym / day(d).
|
||||||
//
|
//
|
||||||
// constexpr year_month_day
|
// constexpr year_month_day
|
||||||
// operator/(const year& y, const month_day& md) noexcept;
|
// operator/(const year& y, const month_day& md) noexcept;
|
||||||
// Returns: y / md.month() / md.day().
|
// Returns: y / md.month() / md.day().
|
||||||
//
|
//
|
||||||
// constexpr year_month_day
|
// constexpr year_month_day
|
||||||
// operator/(int y, const month_day& md) noexcept;
|
// operator/(int y, const month_day& md) noexcept;
|
||||||
// Returns: year(y) / md.
|
// Returns: year(y) / md.
|
||||||
//
|
//
|
||||||
// constexpr year_month_day
|
// constexpr year_month_day
|
||||||
// operator/(const month_day& md, const year& y) noexcept;
|
// operator/(const month_day& md, const year& y) noexcept;
|
||||||
// Returns: y / md.
|
// Returns: y / md.
|
||||||
//
|
//
|
||||||
// constexpr year_month_day
|
// constexpr year_month_day
|
||||||
// operator/(const month_day& md, int y) noexcept;
|
// operator/(const month_day& md, int y) noexcept;
|
||||||
// Returns: year(y) / md.
|
// Returns: year(y) / md.
|
||||||
@@ -62,7 +62,7 @@ int main()
|
|||||||
|
|
||||||
static_assert((Feb2018/day{2}).month() == February, "");
|
static_assert((Feb2018/day{2}).month() == February, "");
|
||||||
static_assert((Feb2018/day{2}).day() == day{2}, "");
|
static_assert((Feb2018/day{2}).day() == day{2}, "");
|
||||||
|
|
||||||
for (int i = 1000; i < 1010; ++i)
|
for (int i = 1000; i < 1010; ++i)
|
||||||
for (int j = 1; j <= 12; ++j)
|
for (int j = 1; j <= 12; ++j)
|
||||||
for (unsigned k = 0; k <= 28; ++k)
|
for (unsigned k = 0; k <= 28; ++k)
|
||||||
@@ -85,7 +85,7 @@ int main()
|
|||||||
|
|
||||||
static_assert((Feb2018/2).month() == February, "");
|
static_assert((Feb2018/2).month() == February, "");
|
||||||
static_assert((Feb2018/2).day() == day{2}, "");
|
static_assert((Feb2018/2).day() == day{2}, "");
|
||||||
|
|
||||||
for (int i = 1000; i < 1010; ++i)
|
for (int i = 1000; i < 1010; ++i)
|
||||||
for (int j = 1; j <= 12; ++j)
|
for (int j = 1; j <= 12; ++j)
|
||||||
for (unsigned k = 0; k <= 28; ++k)
|
for (unsigned k = 0; k <= 28; ++k)
|
||||||
@@ -108,7 +108,7 @@ int main()
|
|||||||
|
|
||||||
static_assert((Feb2018/2).month() == February, "");
|
static_assert((Feb2018/2).month() == February, "");
|
||||||
static_assert((Feb2018/2).day() == day{2}, "");
|
static_assert((Feb2018/2).day() == day{2}, "");
|
||||||
|
|
||||||
for (int i = 1000; i < 1010; ++i)
|
for (int i = 1000; i < 1010; ++i)
|
||||||
for (int j = 1; j <= 12; ++j)
|
for (int j = 1; j <= 12; ++j)
|
||||||
for (unsigned k = 0; k <= 28; ++k)
|
for (unsigned k = 0; k <= 28; ++k)
|
||||||
@@ -137,7 +137,7 @@ int main()
|
|||||||
static_assert((year{2018}/month_day{February, day{2}}).day() == day{2}, "" );
|
static_assert((year{2018}/month_day{February, day{2}}).day() == day{2}, "" );
|
||||||
static_assert((month_day{February, day{2}}/year{2018}).month() == February, "" );
|
static_assert((month_day{February, day{2}}/year{2018}).month() == February, "" );
|
||||||
static_assert((month_day{February, day{2}}/year{2018}).day() == day{2}, "" );
|
static_assert((month_day{February, day{2}}/year{2018}).day() == day{2}, "" );
|
||||||
|
|
||||||
for (int i = 1000; i < 1010; ++i)
|
for (int i = 1000; i < 1010; ++i)
|
||||||
for (int j = 1; j <= 12; ++j)
|
for (int j = 1; j <= 12; ++j)
|
||||||
for (unsigned k = 0; k <= 28; ++k)
|
for (unsigned k = 0; k <= 28; ++k)
|
||||||
@@ -168,7 +168,7 @@ int main()
|
|||||||
static_assert((2018/month_day{February, day{2}}).day() == day{2}, "" );
|
static_assert((2018/month_day{February, day{2}}).day() == day{2}, "" );
|
||||||
static_assert((month_day{February, day{2}}/2018).month() == February, "" );
|
static_assert((month_day{February, day{2}}/2018).month() == February, "" );
|
||||||
static_assert((month_day{February, day{2}}/2018).day() == day{2}, "" );
|
static_assert((month_day{February, day{2}}/2018).day() == day{2}, "" );
|
||||||
|
|
||||||
for (int i = 1000; i < 1010; ++i)
|
for (int i = 1000; i < 1010; ++i)
|
||||||
for (int j = 1; j <= 12; ++j)
|
for (int j = 1; j <= 12; ++j)
|
||||||
for (unsigned k = 0; k <= 28; ++k)
|
for (unsigned k = 0; k <= 28; ++k)
|
||||||
|
|||||||
@@ -18,15 +18,15 @@
|
|||||||
// constexpr year_month_day_last
|
// constexpr year_month_day_last
|
||||||
// operator/(const year& y, const month_day_last& mdl) noexcept;
|
// operator/(const year& y, const month_day_last& mdl) noexcept;
|
||||||
// Returns: {y, mdl}.
|
// Returns: {y, mdl}.
|
||||||
//
|
//
|
||||||
// constexpr year_month_day_last
|
// constexpr year_month_day_last
|
||||||
// operator/(int y, const month_day_last& mdl) noexcept;
|
// operator/(int y, const month_day_last& mdl) noexcept;
|
||||||
// Returns: year(y) / mdl.
|
// Returns: year(y) / mdl.
|
||||||
//
|
//
|
||||||
// constexpr year_month_day_last
|
// constexpr year_month_day_last
|
||||||
// operator/(const month_day_last& mdl, const year& y) noexcept;
|
// operator/(const month_day_last& mdl, const year& y) noexcept;
|
||||||
// Returns: y / mdl.
|
// Returns: y / mdl.
|
||||||
//
|
//
|
||||||
// constexpr year_month_day_last
|
// constexpr year_month_day_last
|
||||||
// operator/(const month_day_last& mdl, int y) noexcept;
|
// operator/(const month_day_last& mdl, int y) noexcept;
|
||||||
// Returns: year(y) / mdl.
|
// Returns: year(y) / mdl.
|
||||||
@@ -53,10 +53,10 @@ int main()
|
|||||||
|
|
||||||
constexpr month February = std::chrono::February;
|
constexpr month February = std::chrono::February;
|
||||||
constexpr std::chrono::last_spec last = std::chrono::last;
|
constexpr std::chrono::last_spec last = std::chrono::last;
|
||||||
|
|
||||||
{ // operator/(const year_month& ym, last_spec)
|
{ // operator/(const year_month& ym, last_spec)
|
||||||
constexpr year_month Feb2018{year{2018}, February};
|
constexpr year_month Feb2018{year{2018}, February};
|
||||||
|
|
||||||
ASSERT_NOEXCEPT ( Feb2018/last);
|
ASSERT_NOEXCEPT ( Feb2018/last);
|
||||||
ASSERT_SAME_TYPE(year_month_day_last, decltype(Feb2018/last));
|
ASSERT_SAME_TYPE(year_month_day_last, decltype(Feb2018/last));
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ int main()
|
|||||||
for (int i = 1000; i < 1010; ++i)
|
for (int i = 1000; i < 1010; ++i)
|
||||||
for (unsigned j = 1; j <= 12; ++j)
|
for (unsigned j = 1; j <= 12; ++j)
|
||||||
{
|
{
|
||||||
year y{i};
|
year y{i};
|
||||||
month m{j};
|
month m{j};
|
||||||
year_month_day_last ymdl = year_month{y,m}/last;
|
year_month_day_last ymdl = year_month{y,m}/last;
|
||||||
assert(ymdl.year() == y);
|
assert(ymdl.year() == y);
|
||||||
@@ -85,11 +85,11 @@ int main()
|
|||||||
static_assert((year{2018}/month_day_last{February}).year() == year{2018}, "");
|
static_assert((year{2018}/month_day_last{February}).year() == year{2018}, "");
|
||||||
static_assert((month_day_last{February}/year{2018}).month() == February, "");
|
static_assert((month_day_last{February}/year{2018}).month() == February, "");
|
||||||
static_assert((month_day_last{February}/year{2018}).year() == year{2018}, "");
|
static_assert((month_day_last{February}/year{2018}).year() == year{2018}, "");
|
||||||
|
|
||||||
for (int i = 1000; i < 1010; ++i)
|
for (int i = 1000; i < 1010; ++i)
|
||||||
for (unsigned j = 1; j <= 12; ++j)
|
for (unsigned j = 1; j <= 12; ++j)
|
||||||
{
|
{
|
||||||
year y{i};
|
year y{i};
|
||||||
month m{j};
|
month m{j};
|
||||||
year_month_day_last ymdl1 = y/month_day_last{m};
|
year_month_day_last ymdl1 = y/month_day_last{m};
|
||||||
year_month_day_last ymdl2 = month_day_last{m}/y;
|
year_month_day_last ymdl2 = month_day_last{m}/y;
|
||||||
@@ -99,7 +99,7 @@ int main()
|
|||||||
assert(ymdl1.year() == y);
|
assert(ymdl1.year() == y);
|
||||||
assert(ymdl1 == ymdl2);
|
assert(ymdl1 == ymdl2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // operator/(int y, const month_day_last& mdl) (and switched)
|
{ // operator/(int y, const month_day_last& mdl) (and switched)
|
||||||
ASSERT_NOEXCEPT ( 2018/month_day_last{February});
|
ASSERT_NOEXCEPT ( 2018/month_day_last{February});
|
||||||
@@ -111,11 +111,11 @@ int main()
|
|||||||
static_assert((2018/month_day_last{February}).year() == year{2018}, "");
|
static_assert((2018/month_day_last{February}).year() == year{2018}, "");
|
||||||
static_assert((month_day_last{February}/2018).month() == February, "");
|
static_assert((month_day_last{February}/2018).month() == February, "");
|
||||||
static_assert((month_day_last{February}/2018).year() == year{2018}, "");
|
static_assert((month_day_last{February}/2018).year() == year{2018}, "");
|
||||||
|
|
||||||
for (int i = 1000; i < 1010; ++i)
|
for (int i = 1000; i < 1010; ++i)
|
||||||
for (unsigned j = 1; j <= 12; ++j)
|
for (unsigned j = 1; j <= 12; ++j)
|
||||||
{
|
{
|
||||||
year y{i};
|
year y{i};
|
||||||
month m{j};
|
month m{j};
|
||||||
year_month_day_last ymdl1 = i/month_day_last{m};
|
year_month_day_last ymdl1 = i/month_day_last{m};
|
||||||
year_month_day_last ymdl2 = month_day_last{m}/i;
|
year_month_day_last ymdl2 = month_day_last{m}/i;
|
||||||
@@ -125,5 +125,5 @@ int main()
|
|||||||
assert(ymdl1.year() == y);
|
assert(ymdl1.year() == y);
|
||||||
assert(ymdl1 == ymdl2);
|
assert(ymdl1 == ymdl2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,19 +14,19 @@
|
|||||||
// constexpr year_month_weekday
|
// constexpr year_month_weekday
|
||||||
// operator/(const year_month& ym, const weekday_indexed& wdi) noexcept;
|
// operator/(const year_month& ym, const weekday_indexed& wdi) noexcept;
|
||||||
// Returns: {ym.year(), ym.month(), wdi}.
|
// Returns: {ym.year(), ym.month(), wdi}.
|
||||||
//
|
//
|
||||||
// constexpr year_month_weekday
|
// constexpr year_month_weekday
|
||||||
// operator/(const year& y, const month_weekday& mwd) noexcept;
|
// operator/(const year& y, const month_weekday& mwd) noexcept;
|
||||||
// Returns: {y, mwd.month(), mwd.weekday_indexed()}.
|
// Returns: {y, mwd.month(), mwd.weekday_indexed()}.
|
||||||
//
|
//
|
||||||
// constexpr year_month_weekday
|
// constexpr year_month_weekday
|
||||||
// operator/(int y, const month_weekday& mwd) noexcept;
|
// operator/(int y, const month_weekday& mwd) noexcept;
|
||||||
// Returns: year(y) / mwd.
|
// Returns: year(y) / mwd.
|
||||||
//
|
//
|
||||||
// constexpr year_month_weekday
|
// constexpr year_month_weekday
|
||||||
// operator/(const month_weekday& mwd, const year& y) noexcept;
|
// operator/(const month_weekday& mwd, const year& y) noexcept;
|
||||||
// Returns: y / mwd.
|
// Returns: y / mwd.
|
||||||
//
|
//
|
||||||
// constexpr year_month_weekday
|
// constexpr year_month_weekday
|
||||||
// operator/(const month_weekday& mwd, int y) noexcept;
|
// operator/(const month_weekday& mwd, int y) noexcept;
|
||||||
// Returns: year(y) / mwd.
|
// Returns: year(y) / mwd.
|
||||||
@@ -52,10 +52,10 @@ int main()
|
|||||||
constexpr weekday Tuesday = std::chrono::Tuesday;
|
constexpr weekday Tuesday = std::chrono::Tuesday;
|
||||||
constexpr month February = std::chrono::February;
|
constexpr month February = std::chrono::February;
|
||||||
|
|
||||||
|
|
||||||
{ // operator/(const year_month& ym, const weekday_indexed& wdi)
|
{ // operator/(const year_month& ym, const weekday_indexed& wdi)
|
||||||
constexpr year_month Feb2018{year{2018}, February};
|
constexpr year_month Feb2018{year{2018}, February};
|
||||||
|
|
||||||
ASSERT_NOEXCEPT ( Feb2018/weekday_indexed{Tuesday, 2});
|
ASSERT_NOEXCEPT ( Feb2018/weekday_indexed{Tuesday, 2});
|
||||||
ASSERT_SAME_TYPE(year_month_weekday, decltype(Feb2018/weekday_indexed{Tuesday, 2}));
|
ASSERT_SAME_TYPE(year_month_weekday, decltype(Feb2018/weekday_indexed{Tuesday, 2}));
|
||||||
|
|
||||||
@@ -141,5 +141,5 @@ int main()
|
|||||||
assert(ymd2.weekday() == wd);
|
assert(ymd2.weekday() == wd);
|
||||||
assert(ymd1 == ymd2);
|
assert(ymd1 == ymd2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,19 +14,19 @@
|
|||||||
// constexpr year_month_weekday_last
|
// constexpr year_month_weekday_last
|
||||||
// operator/(const year_month& ym, const weekday_last& wdl) noexcept;
|
// operator/(const year_month& ym, const weekday_last& wdl) noexcept;
|
||||||
// Returns: {ym.year(), ym.month(), wdl}.
|
// Returns: {ym.year(), ym.month(), wdl}.
|
||||||
//
|
//
|
||||||
// constexpr year_month_weekday_last
|
// constexpr year_month_weekday_last
|
||||||
// operator/(const year& y, const month_weekday_last& mwdl) noexcept;
|
// operator/(const year& y, const month_weekday_last& mwdl) noexcept;
|
||||||
// Returns: {y, mwdl.month(), mwdl.weekday_last()}.
|
// Returns: {y, mwdl.month(), mwdl.weekday_last()}.
|
||||||
//
|
//
|
||||||
// constexpr year_month_weekday_last
|
// constexpr year_month_weekday_last
|
||||||
// operator/(int y, const month_weekday_last& mwdl) noexcept;
|
// operator/(int y, const month_weekday_last& mwdl) noexcept;
|
||||||
// Returns: year(y) / mwdl.
|
// Returns: year(y) / mwdl.
|
||||||
//
|
//
|
||||||
// constexpr year_month_weekday_last
|
// constexpr year_month_weekday_last
|
||||||
// operator/(const month_weekday_last& mwdl, const year& y) noexcept;
|
// operator/(const month_weekday_last& mwdl, const year& y) noexcept;
|
||||||
// Returns: y / mwdl.
|
// Returns: y / mwdl.
|
||||||
//
|
//
|
||||||
// constexpr year_month_weekday_last
|
// constexpr year_month_weekday_last
|
||||||
// operator/(const month_weekday_last& mwdl, int y) noexcept;
|
// operator/(const month_weekday_last& mwdl, int y) noexcept;
|
||||||
// Returns: year(y) / mwdl.
|
// Returns: year(y) / mwdl.
|
||||||
@@ -53,7 +53,7 @@ int main()
|
|||||||
|
|
||||||
constexpr weekday Tuesday = std::chrono::Tuesday;
|
constexpr weekday Tuesday = std::chrono::Tuesday;
|
||||||
constexpr month February = std::chrono::February;
|
constexpr month February = std::chrono::February;
|
||||||
|
|
||||||
{ // operator/(const year_month& ym, const weekday_last& wdl) (and switched)
|
{ // operator/(const year_month& ym, const weekday_last& wdl) (and switched)
|
||||||
constexpr year_month Feb2018{year{2018}, February};
|
constexpr year_month Feb2018{year{2018}, February};
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ int main()
|
|||||||
static_assert((Feb2018/weekday_last{Tuesday}).year() == year{2018}, "");
|
static_assert((Feb2018/weekday_last{Tuesday}).year() == year{2018}, "");
|
||||||
static_assert((Feb2018/weekday_last{Tuesday}).month() == February, "");
|
static_assert((Feb2018/weekday_last{Tuesday}).month() == February, "");
|
||||||
static_assert((Feb2018/weekday_last{Tuesday}).weekday() == Tuesday, "");
|
static_assert((Feb2018/weekday_last{Tuesday}).weekday() == Tuesday, "");
|
||||||
|
|
||||||
for (int i = 1000; i < 1010; ++i)
|
for (int i = 1000; i < 1010; ++i)
|
||||||
for (unsigned j = 1; j <= 12; ++j)
|
for (unsigned j = 1; j <= 12; ++j)
|
||||||
for (unsigned k = 0; k <= 6; ++k)
|
for (unsigned k = 0; k <= 6; ++k)
|
||||||
@@ -81,7 +81,7 @@ int main()
|
|||||||
|
|
||||||
{ // operator/(const year& y, const month_weekday_last& mwdl) (and switched)
|
{ // operator/(const year& y, const month_weekday_last& mwdl) (and switched)
|
||||||
constexpr month_weekday_last FebLastTues{February, weekday_last{Tuesday}};
|
constexpr month_weekday_last FebLastTues{February, weekday_last{Tuesday}};
|
||||||
|
|
||||||
ASSERT_NOEXCEPT ( year{2018}/FebLastTues);
|
ASSERT_NOEXCEPT ( year{2018}/FebLastTues);
|
||||||
ASSERT_SAME_TYPE(year_month_weekday_last, decltype(year{2018}/FebLastTues));
|
ASSERT_SAME_TYPE(year_month_weekday_last, decltype(year{2018}/FebLastTues));
|
||||||
ASSERT_NOEXCEPT ( FebLastTues/year{2018});
|
ASSERT_NOEXCEPT ( FebLastTues/year{2018});
|
||||||
@@ -118,7 +118,7 @@ int main()
|
|||||||
|
|
||||||
{ // operator/(int y, const month_weekday_last& mwdl) (and switched)
|
{ // operator/(int y, const month_weekday_last& mwdl) (and switched)
|
||||||
constexpr month_weekday_last FebLastTues{February, weekday_last{Tuesday}};
|
constexpr month_weekday_last FebLastTues{February, weekday_last{Tuesday}};
|
||||||
|
|
||||||
ASSERT_NOEXCEPT ( 2018/FebLastTues);
|
ASSERT_NOEXCEPT ( 2018/FebLastTues);
|
||||||
ASSERT_SAME_TYPE(year_month_weekday_last, decltype(2018/FebLastTues));
|
ASSERT_SAME_TYPE(year_month_weekday_last, decltype(2018/FebLastTues));
|
||||||
ASSERT_NOEXCEPT ( FebLastTues/2018);
|
ASSERT_NOEXCEPT ( FebLastTues/2018);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
// constexpr chrono::weekday weekday() const noexcept;
|
// constexpr chrono::weekday weekday() const noexcept;
|
||||||
// constexpr unsigned index() const noexcept;
|
// constexpr unsigned index() const noexcept;
|
||||||
// constexpr bool ok() const noexcept;
|
// constexpr bool ok() const noexcept;
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@@ -34,7 +34,7 @@ int main()
|
|||||||
|
|
||||||
ASSERT_NOEXCEPT(weekday_indexed{});
|
ASSERT_NOEXCEPT(weekday_indexed{});
|
||||||
ASSERT_NOEXCEPT(weekday_indexed(weekday{1}, 1));
|
ASSERT_NOEXCEPT(weekday_indexed(weekday{1}, 1));
|
||||||
|
|
||||||
constexpr weekday_indexed wdi0{};
|
constexpr weekday_indexed wdi0{};
|
||||||
static_assert( wdi0.weekday() == weekday{}, "");
|
static_assert( wdi0.weekday() == weekday{}, "");
|
||||||
static_assert( wdi0.index() == 0, "");
|
static_assert( wdi0.index() == 0, "");
|
||||||
@@ -44,7 +44,7 @@ int main()
|
|||||||
static_assert( wdi1.weekday() == std::chrono::Sunday, "");
|
static_assert( wdi1.weekday() == std::chrono::Sunday, "");
|
||||||
static_assert( wdi1.index() == 2, "");
|
static_assert( wdi1.index() == 2, "");
|
||||||
static_assert( wdi1.ok(), "");
|
static_assert( wdi1.ok(), "");
|
||||||
|
|
||||||
for (unsigned i = 1; i <= 5; ++i)
|
for (unsigned i = 1; i <= 5; ++i)
|
||||||
{
|
{
|
||||||
weekday_indexed wdi(std::chrono::Tuesday, i);
|
weekday_indexed wdi(std::chrono::Tuesday, i);
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ int main()
|
|||||||
|
|
||||||
AssertComparisons2AreNoexcept<weekday_indexed>();
|
AssertComparisons2AreNoexcept<weekday_indexed>();
|
||||||
AssertComparisons2ReturnBool<weekday_indexed>();
|
AssertComparisons2ReturnBool<weekday_indexed>();
|
||||||
|
|
||||||
static_assert( (weekday_indexed{} == weekday_indexed{}), "");
|
static_assert( (weekday_indexed{} == weekday_indexed{}), "");
|
||||||
static_assert(!(weekday_indexed{} != weekday_indexed{}), "");
|
static_assert(!(weekday_indexed{} != weekday_indexed{}), "");
|
||||||
|
|
||||||
static_assert(!(weekday_indexed{} == weekday_indexed{std::chrono::Tuesday, 1}), "");
|
static_assert(!(weekday_indexed{} == weekday_indexed{std::chrono::Tuesday, 1}), "");
|
||||||
static_assert( (weekday_indexed{} != weekday_indexed{std::chrono::Tuesday, 1}), "");
|
static_assert( (weekday_indexed{} != weekday_indexed{std::chrono::Tuesday, 1}), "");
|
||||||
|
|
||||||
// Some 'ok' values as well
|
// Some 'ok' values as well
|
||||||
static_assert( (weekday_indexed{weekday{1}, 2} == weekday_indexed{weekday{1}, 2}), "");
|
static_assert( (weekday_indexed{weekday{1}, 2} == weekday_indexed{weekday{1}, 2}), "");
|
||||||
static_assert(!(weekday_indexed{weekday{1}, 2} != weekday_indexed{weekday{1}, 2}), "");
|
static_assert(!(weekday_indexed{weekday{1}, 2} != weekday_indexed{weekday{1}, 2}), "");
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
// basic_ostream<charT, traits>&
|
// basic_ostream<charT, traits>&
|
||||||
// operator<<(basic_ostream<charT, traits>& os, const weekday_indexed& wdi);
|
// operator<<(basic_ostream<charT, traits>& os, const weekday_indexed& wdi);
|
||||||
//
|
//
|
||||||
// Effects: os << wdi.weekday() << '[' << wdi.index().
|
// Effects: os << wdi.weekday() << '[' << wdi.index().
|
||||||
// If wdi.index() is in the range [1, 5], appends with ']',
|
// If wdi.index() is in the range [1, 5], appends with ']',
|
||||||
// otherwise appends with " is not a valid index]".
|
// otherwise appends with " is not a valid index]".
|
||||||
|
|
||||||
|
|
||||||
@@ -31,6 +31,6 @@ int main()
|
|||||||
{
|
{
|
||||||
using weekday_indexed = std::chrono::weekday_indexed;
|
using weekday_indexed = std::chrono::weekday_indexed;
|
||||||
using weekday = std::chrono::weekday;
|
using weekday = std::chrono::weekday;
|
||||||
|
|
||||||
std::cout << weekday_indexed{weekday{3}};
|
std::cout << weekday_indexed{weekday{3}};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
using weekday_indexed = std::chrono::weekday_indexed;
|
using weekday_indexed = std::chrono::weekday_indexed;
|
||||||
|
|
||||||
static_assert(std::is_trivially_copyable_v<weekday_indexed>, "");
|
static_assert(std::is_trivially_copyable_v<weekday_indexed>, "");
|
||||||
static_assert(std::is_standard_layout_v<weekday_indexed>, "");
|
static_assert(std::is_standard_layout_v<weekday_indexed>, "");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ int main()
|
|||||||
using weekday_last = std::chrono::weekday_last;
|
using weekday_last = std::chrono::weekday_last;
|
||||||
|
|
||||||
ASSERT_NOEXCEPT(weekday_last{weekday{}});
|
ASSERT_NOEXCEPT(weekday_last{weekday{}});
|
||||||
|
|
||||||
constexpr weekday_last wdl0{weekday{}};
|
constexpr weekday_last wdl0{weekday{}};
|
||||||
static_assert( wdl0.weekday() == weekday{}, "");
|
static_assert( wdl0.weekday() == weekday{}, "");
|
||||||
static_assert( wdl0.ok(), "");
|
static_assert( wdl0.ok(), "");
|
||||||
@@ -38,7 +38,7 @@ int main()
|
|||||||
constexpr weekday_last wdl1 {weekday{1}};
|
constexpr weekday_last wdl1 {weekday{1}};
|
||||||
static_assert( wdl1.weekday() == weekday{1}, "");
|
static_assert( wdl1.weekday() == weekday{1}, "");
|
||||||
static_assert( wdl1.ok(), "");
|
static_assert( wdl1.ok(), "");
|
||||||
|
|
||||||
for (unsigned i = 0; i <= 255; ++i)
|
for (unsigned i = 0; i <= 255; ++i)
|
||||||
{
|
{
|
||||||
weekday_last wdl{weekday{i}};
|
weekday_last wdl{weekday{i}};
|
||||||
|
|||||||
@@ -29,14 +29,14 @@ int main()
|
|||||||
|
|
||||||
AssertComparisons2AreNoexcept<weekday_last>();
|
AssertComparisons2AreNoexcept<weekday_last>();
|
||||||
AssertComparisons2ReturnBool<weekday_last>();
|
AssertComparisons2ReturnBool<weekday_last>();
|
||||||
|
|
||||||
static_assert(testComparisons2Values<weekday_last>(weekday{0}, weekday{0}), "");
|
static_assert(testComparisons2Values<weekday_last>(weekday{0}, weekday{0}), "");
|
||||||
static_assert(testComparisons2Values<weekday_last>(weekday{0}, weekday{1}), "");
|
static_assert(testComparisons2Values<weekday_last>(weekday{0}, weekday{1}), "");
|
||||||
|
|
||||||
// Some 'ok' values as well
|
// Some 'ok' values as well
|
||||||
static_assert(testComparisons2Values<weekday_last>(weekday{2}, weekday{2}), "");
|
static_assert(testComparisons2Values<weekday_last>(weekday{2}, weekday{2}), "");
|
||||||
static_assert(testComparisons2Values<weekday_last>(weekday{2}, weekday{3}), "");
|
static_assert(testComparisons2Values<weekday_last>(weekday{2}, weekday{3}), "");
|
||||||
|
|
||||||
for (unsigned i = 0; i < 6; ++i)
|
for (unsigned i = 0; i < 6; ++i)
|
||||||
for (unsigned j = 0; j < 6; ++j)
|
for (unsigned j = 0; j < 6; ++j)
|
||||||
assert(testComparisons2Values<weekday_last>(weekday{i}, weekday{j}));
|
assert(testComparisons2Values<weekday_last>(weekday{i}, weekday{j}));
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
// template<class charT, class traits>
|
// template<class charT, class traits>
|
||||||
// basic_ostream<charT, traits>&
|
// basic_ostream<charT, traits>&
|
||||||
// operator<<(basic_ostream<charT, traits>& os, const weekday_last& wdl);
|
// operator<<(basic_ostream<charT, traits>& os, const weekday_last& wdl);
|
||||||
//
|
//
|
||||||
// Returns: os << wdl.weekday() << "[last]".
|
// Returns: os << wdl.weekday() << "[last]".
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@@ -29,6 +29,6 @@ int main()
|
|||||||
{
|
{
|
||||||
using weekday_last = std::chrono::weekday_last;
|
using weekday_last = std::chrono::weekday_last;
|
||||||
using weekday = std::chrono::weekday;
|
using weekday = std::chrono::weekday;
|
||||||
|
|
||||||
std::cout << weekday_last{weekday{3}};
|
std::cout << weekday_last{weekday{3}};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
using weekday_last = std::chrono::weekday_last;
|
using weekday_last = std::chrono::weekday_last;
|
||||||
|
|
||||||
static_assert(std::is_trivially_copyable_v<weekday_last>, "");
|
static_assert(std::is_trivially_copyable_v<weekday_last>, "");
|
||||||
static_assert(std::is_standard_layout_v<weekday_last>, "");
|
static_assert(std::is_standard_layout_v<weekday_last>, "");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,13 +34,13 @@ int main()
|
|||||||
ASSERT_NOEXCEPT(weekday{});
|
ASSERT_NOEXCEPT(weekday{});
|
||||||
ASSERT_NOEXCEPT(weekday(1));
|
ASSERT_NOEXCEPT(weekday(1));
|
||||||
ASSERT_NOEXCEPT(static_cast<unsigned>(weekday(1)));
|
ASSERT_NOEXCEPT(static_cast<unsigned>(weekday(1)));
|
||||||
|
|
||||||
constexpr weekday m0{};
|
constexpr weekday m0{};
|
||||||
static_assert(static_cast<unsigned>(m0) == 0, "");
|
static_assert(static_cast<unsigned>(m0) == 0, "");
|
||||||
|
|
||||||
constexpr weekday m1{1};
|
constexpr weekday m1{1};
|
||||||
static_assert(static_cast<unsigned>(m1) == 1, "");
|
static_assert(static_cast<unsigned>(m1) == 1, "");
|
||||||
|
|
||||||
for (unsigned i = 0; i <= 255; ++i)
|
for (unsigned i = 0; i <= 255; ++i)
|
||||||
{
|
{
|
||||||
weekday m(i);
|
weekday m(i);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user