diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-22 16:52:53 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-22 16:52:53 +0000 |
| commit | 375122a03b870ed00f2c4c452d8c939e2039ffec (patch) | |
| tree | 6f60e84686771f39ed56f3a3ac78871340a9097a /test/std/containers/sequences/array/indexing.pass.cpp | |
| parent | fd857c8184809f0fac54f7ec9d9e91477beb1b7d (diff) | |
Notes
Diffstat (limited to 'test/std/containers/sequences/array/indexing.pass.cpp')
| -rw-r--r-- | test/std/containers/sequences/array/indexing.pass.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/std/containers/sequences/array/indexing.pass.cpp b/test/std/containers/sequences/array/indexing.pass.cpp index 64d2716a7592..6cb7941d92c5 100644 --- a/test/std/containers/sequences/array/indexing.pass.cpp +++ b/test/std/containers/sequences/array/indexing.pass.cpp @@ -23,6 +23,14 @@ // Disable the missing braces warning for this reason. #include "disable_missing_braces_warning.h" +#if TEST_STD_VER > 14 +constexpr bool check_idx( size_t idx, double val ) +{ + std::array<double, 3> arr = {1, 2, 3.5}; + return arr[idx] == val; +} +#endif + int main() { { @@ -63,4 +71,11 @@ int main() } #endif +#if TEST_STD_VER > 14 + { + static_assert (check_idx(0, 1), ""); + static_assert (check_idx(1, 2), ""); + static_assert (check_idx(2, 3.5), ""); + } +#endif } |
