==== Patch level 1 Source: [No source] Target: 220cfe23-bf16-0410-a8f0-df5224326cd0:/local/boost/libs/multi_index/example:3321 [local] Log: Jamfile.v2: ip_allocator requires multi ip_allocator.cpp: added error handling when reading input fails (e.g. eof). === Jamfile.v2 ================================================================== --- Jamfile.v2 (revision 3321) +++ Jamfile.v2 (patch multi-index-1.35.0-prerelease-example-fixes level 1) @@ -39,7 +39,7 @@ exe ip_allocator : ip_allocator.cpp - : $(BOOST_ROOT) + : $(BOOST_ROOT) multi ; exe non_default_ctor === ip_allocator.cpp ================================================================== --- ip_allocator.cpp (revision 3321) +++ ip_allocator.cpp (patch multi-index-1.35.0-prerelease-example-fixes level 1) @@ -128,27 +128,31 @@ /* A small utility to get data entered via std::cin */ template -void enter(const char* msg,T& t) +bool enter(const char* msg,T& t) { std::cout<>t; + return true; } -void enter(const char* msg,std::string& str) +bool enter(const char* msg,std::string& str) { std::cout< lock(mutex); pbc->insert(b); @@ -246,9 +261,12 @@ case 4:{ /* delete a book */ shared_string name( shared_string::allocator_type(seg.get_segment_manager())); - enter( - "name of the book (you can enter\nonly the first few characters): ", - name); + if (!enter( + "name of the book (you can enter\nonly the first few characters): ", + name)) { + exit = true; + break; + } typedef nth_index::type index_by_name; index_by_name& idx=get<1>(*pbc); @@ -274,7 +292,10 @@ std::cout<<"delete the following?\n"< lock(mutex); idx.erase(it);