tag.h

00001 /*
00002  * ASTL - the Automaton Standard Template Library.
00003  * C++ generic components for Finite State Automata handling.
00004  * Copyright (C) 2000-2003 Vincent Le Maout (vincent.lemaout@chello.fr).
00005  * 
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  * 
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 #ifndef ASTL_TAG_H
00023 #define ASTL_TAG_H
00024 
00025 #include <iostream>
00026 using namespace std;
00027 
00028 namespace astl {
00029 
00030 struct empty_tag 
00031 {
00032   template <typename T>
00033   empty_tag& operator=(const T&) { return *this; }
00034 };
00035 
00036 typedef empty_tag empty;
00037 
00038 inline bool operator==(const empty_tag&, const empty_tag&) { return true; }
00039 inline bool operator<(const empty_tag&, const empty_tag&) { return false; }
00040 inline ostream& operator<<(ostream &out, const empty_tag&) { return out; }
00041 inline istream& operator>>(istream &in, empty_tag&) { return in; }
00042 
00043 #if (__GNUG__ > 0) && (__GNUG__ < 4)
00044 // Specialized type_traits for empty_tag
00045 template <>
00046 struct __type_traits<empty_tag>
00047 {
00048   typedef __true_type has_trivial_default_constructor;
00049   typedef __true_type has_trivial_copy_constructor;
00050   typedef __true_type has_trivial_assignment_operator;
00051   typedef __true_type has_trivial_destructor;
00052   typedef __true_type is_POD_type;
00053 };
00054 #endif
00055 
00056 } // namespace astl
00057 
00058 #endif // ASTL_TAG_H

Generated on Sun Mar 8 02:41:35 2009 for ASTL by  doxygen 1.5.7.1