1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // <vector> 11 // vector<bool> 12 13 // std::find with vector<bool>::iterator 14 15 // http://llvm.org/bugs/show_bug.cgi?id=16816 16 17 #include <vector> 18 #include <cassert> 19 main()20int main() 21 { 22 { 23 for (unsigned i = 1; i < 256; ++i) 24 { 25 std::vector<bool> b(i,true); 26 std::vector<bool>::iterator j = std::find(b.begin()+1, b.end(), false); 27 assert(j-b.begin() == i); 28 assert(b.end() == j); 29 } 30 } 31 { 32 for (unsigned i = 1; i < 256; ++i) 33 { 34 std::vector<bool> b(i,false); 35 std::vector<bool>::iterator j = std::find(b.begin()+1, b.end(), true); 36 assert(j-b.begin() == i); 37 assert(b.end() == j); 38 } 39 } 40 } 41