// ----------------------------------------------------------------------
//
// splice.cc - Does <list>'s splice() behave correctly?
//
// History:
//   18-Sep-2000  WEB  Initial draft, adapted from a demo program by
//   25-Apr-2001  WEB  s/<ISOcxxSyntax.hh>/"ISOcxx\/ISOcxxSyntax.hh"/
//                     Igor Terekhov
//
// ----------------------------------------------------------------------


#include "ISOcxx/ISOcxxSyntax.hh"
#include <list>


int  main()  {

  typedef  std::list<int>  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()
