/* Copyright (c) 1997-2004
   Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany)
   http://www.math.tu-berlin.de/polymake,  mailto:polymake@math.tu-berlin.de

   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2, or (at your option) any
   later version: http://www.gnu.org/licenses/gpl.txt.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
*/

#ifndef _POLYMAKE_STD_SET
#define _POLYMAKE_STD_SET "$Project: polymake $$Id: set,v 1.3 2004/06/22 16:22:42 gawrilow Exp $"

#include_next <set>

#ifdef __INTEL_COMPILER
# ifndef _POLYMAKE_ITERATORS_H
#  include <iterators.h>
# endif
#else
# ifndef _POLYMAKE_TYPE_MANIP_H
#  include <type_manip.h>
# endif
#endif

namespace pm {

template <typename K, typename Compare, typename Alloc>
struct spec_object_traits< std::set<K,Compare,Alloc> >
   : spec_object_traits<is_container> {
   static const IO_separator_kind IO_separator=IO_sep_inherit;
};

#ifdef __INTEL_COMPILER
namespace std_nested_iterators {
   enum { set=8, set_alloc=9, set__alloc=10 };
   typedef char (&_set)[set];
   typedef char (&_set_alloc)[set_alloc];
   typedef char (&_set__alloc)[set__alloc];

   template <typename Iterator, typename Value>
   typename if_else< derived_from<typename std::set<Value, std::less<Value> >::iterator, Iterator>::answer,
		     _set, _unmatched >::result
   f(Iterator*, Value*, typename std::set<Value, std::less<Value> >::const_iterator*);

   template <typename Iterator, typename Value>
   typename if_else< derived_from<typename std::set<Value, std::less<Value>, alloc>::iterator, Iterator>::answer,
		     _set_alloc, _unmatched >::result
   f(Iterator*, Value*, typename std::set<Value, std::less<Value>, alloc>::const_iterator*);

   template <typename Iterator, typename Value>
   typename if_else< derived_from<typename std::set<Value, std::less<Value>,
						    std::__allocator<Value,raw_alloc> >::iterator, Iterator>::answer,
		     _set__alloc, _unmatched >::result
   f(Iterator*, Value*, typename std::set<Value, std::less<Value>, std::__allocator<Value,raw_alloc> >::const_iterator*);

   template <typename Iterator, typename Value>
   struct extractor<Iterator, Value, set> {
      typedef typename std::set<Value, std::less<Value> >::iterator iterator;
      typedef typename std::set<Value, std::less<Value> >::const_iterator const_iterator;
   };

   template <typename Iterator, typename Value>
   struct extractor<Iterator, Value, set_alloc> {
      typedef typename std::set<Value, std::less<Value>, alloc>::iterator iterator;
      typedef typename std::set<Value, std::less<Value>, alloc>::const_iterator const_iterator;
   };

   template <typename Iterator, typename Value>
   struct extractor<Iterator, Value, set__alloc> {
      typedef typename std::set<Value, std::less<Value>, std::__allocator<Value,raw_alloc> >::iterator iterator;
      typedef typename std::set<Value, std::less<Value>, std::__allocator<Value,raw_alloc> >::const_iterator const_iterator;
   };
}
#endif // __INTEL_COMPILER

} // end namespace pm

#endif // _POLYMAKE_STD_SET

// Local Variables:
// mode:C++
// End:
