forked from OSchip/llvm-project
parent
56004c577a
commit
f90ec0e82e
|
@ -17,12 +17,18 @@
|
|||
|
||||
int main()
|
||||
{
|
||||
|
||||
bool a[] = {false, true, false, true};
|
||||
bool* an = a + sizeof(a)/sizeof(a[0]);
|
||||
|
||||
std::vector<bool> v(a, an);
|
||||
std::vector<bool>::reference r1 = v[0];
|
||||
std::vector<bool>::reference r2 = v[3];
|
||||
|
||||
#if __has_feature(cxx_noexcept)
|
||||
static_assert((noexcept(v.swap(r1,r2))), "");
|
||||
#endif
|
||||
|
||||
assert(!r1);
|
||||
assert( r2);
|
||||
v.swap(r1, r2);
|
||||
|
|
Loading…
Reference in New Issue