17 #ifndef VCSN_MISC_UNIQUE_HXX
18 # define VCSN_MISC_UNIQUE_HXX
28 # if defined (__GNUC__)
29 # if defined (__GNUC_MINOR__) && defined (__GNUC_PATCHLEVEL__)
30 # if (__GNUC__ == 4) && (__GNUC_MINOR__ == 0) && (__GNUC_PATCHLEVEL__ == 0)
31 template class UniqueMap<int>::TiSlot<
int>;
39 unique_map::ti_slot::TiSlot (
const std::type_info& _id) : id (_id)
48 operator== (
const unique_map::ti_slot& other)
const
50 return id == other.id;
56 bool unique_map::ti_slot::
57 operator< (
const unique_map::ti_slot& other)
const
59 return id.before (other.id);
63 uniquelist<T>::~uniquelist ()
67 unifiable::unifiable () : unique_ (false)
71 unifiable::unifiable (
const unifiable& ) : unique_ (false)
75 const T&
get (
const T& v)
77 if (static_cast<const unifiable&> (v).unique_)
82 unique_map::map_t::iterator i = m.find (
typeid (T));
88 static_cast<unifiable&
> (l->front ()).unique_ =
true;
94 if ((j = std::find (l->begin (), l->end (), v)) == l->end ())
97 static_cast<unifiable&
> (l->front ()).unique_ =
true;
103 template <
typename T>
104 const T*
get (
const T* v)
111 uniquelist_base::~UniqueListBase () {}
114 typename UniqueMap<T>::map_t&
118 return instance_.map_;
129 for (
typename map_t::iterator i = map_.begin ();
139 #endif // ! VCSN_MISC_UNIQUE_HXX