// ---------------------------------------------------------------------- // // splice.cc - Does 's splice() behave correctly? // // History: // 18-Sep-2000 WEB Initial draft, adapted from a demo program by // 25-Apr-2001 WEB s//"ISOcxx\/ISOcxxSyntax.hh"/ // Igor Terekhov // // ---------------------------------------------------------------------- #include "ISOcxx/ISOcxxSyntax.hh" #include int main() { typedef std::list IntList; IntList L; L.push_back( 0 ); #ifndef DEFECT_BAD_LIST_SPLICE L.splice( L.end(), L, L.begin(), L.end() ); #else // defective #endif IntList::const_iterator ci( L.begin() ); if ( ci == L.end() ) return 1; if ( L.size() != 1 ) return 2; return *ci; } // main()