ivl 679
|
00001 /* This file is part of the ivl C++ library <http://image.ntua.gr/ivl>. 00002 A C++ template library extending syntax towards mathematical notation. 00003 00004 Copyright (C) 2012 Yannis Avrithis <iavr@image.ntua.gr> 00005 Copyright (C) 2012 Kimon Kontosis <kimonas@image.ntua.gr> 00006 00007 ivl is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU Lesser General Public License 00009 version 3 as published by the Free Software Foundation. 00010 00011 Alternatively, you can redistribute it and/or modify it under the terms 00012 of the GNU General Public License version 2 as published by the Free 00013 Software Foundation. 00014 00015 ivl is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00018 See the GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 and a copy of the GNU Lesser General Public License along 00022 with ivl. If not, see <http://www.gnu.org/licenses/>. */ 00023 00024 #ifndef IVL_CORE_DETAILS_TYPES_ENTITY_HPP 00025 #define IVL_CORE_DETAILS_TYPES_ENTITY_HPP 00026 00027 namespace ivl { 00028 00029 // ivl function argument list separator 00030 struct sep { }; 00031 00032 namespace types { 00033 00034 // empty terminator struct 00035 struct term { }; 00036 00037 // struct passed as argument to differentiate overloaded functions 00038 template<int N = 0> 00039 struct code_word 00040 { 00041 code_word() { } 00042 }; 00043 00044 // struct to become a substitute template base class that does nothing 00045 template<class T> 00046 struct nop_base { }; 00047 00048 // used as an l-value with combination of r_if to disable/enable assignments 00049 struct skip 00050 { 00051 skip() {} 00052 template<class K> 00053 skip(const K& x) {} 00054 //template<class K> 00055 //const skip& operator=(const K& x) const { return *this; } 00056 skip& operator=(const skip& x) { return *this; } 00057 const skip& operator=(const skip& x) const { return *this; } 00058 }; 00059 00060 // argument to disable function 00061 struct invalid_arg 00062 { 00063 template<class X> 00064 invalid_arg(X){} 00065 }; 00066 00067 // argument to disable function, when used many times 00068 template<int N> 00069 struct invalid_arg_n 00070 { 00071 template<class X> 00072 invalid_arg_n(X){} 00073 }; 00074 template<class T> 00075 struct invalid_arg_t 00076 { 00077 template<class X> 00078 invalid_arg_t(X){}; 00079 }; 00080 00081 // disabled type 00082 class not_a_type 00083 { 00084 private: 00085 not_a_type() {}; 00086 }; 00087 00088 } /* namespace types */ 00089 } /* namespace ivl */ 00090 00091 #endif // IVL_CORE_DETAILS_TYPES_ENTITY_HPP