00001 /* 00002 The STL+ C++ Library Collection 00003 00004 Website <http://stlplus.sourceforge.net/> Collection <index.html> 00005 00006 00007 License Agreement 00008 00009 <http://www.opensource.org/> 00010 00011 * License for using the STLplus Library Collection <#license> 00012 * The Intent of this License <#intent> 00013 * How to Comply with this License <#compliance> 00014 * Historical Note <#history> 00015 00016 00017 License for using the STLplus Library Collection 00018 00019 *© 1999-2008 Andy Rushton. All rights reserved.* 00020 00021 Redistribution and use in source and binary forms, with or without 00022 modification, are permitted provided that the following conditions are met: 00023 00024 * Redistributions of source code must retain the above Copyright 00025 notice, this list of conditions and the following disclaimer. 00026 * Redistributions in binary form must reproduce the above Copyright 00027 notice, this list of conditions and the following disclaimer in 00028 the documentation and/or other materials provided with the 00029 distribution. 00030 * Neither the name of the STLplus library nor the names of its 00031 contributors may be used to endorse or promote products derived 00032 from this software without specific prior written permission. 00033 00034 This software is provided by the Copyright holders and contributors "as 00035 is" and any express or implied warranties, including, but not limited 00036 to, the implied warranties of merchantability and fitness for a 00037 particular purpose are disclaimed. In no event shall the Copyright owner 00038 or contributors be liable for any direct, indirect, incidental, special, 00039 exemplary, or consequential damages (including, but not limited to, 00040 procurement of substitute goods or services; loss of use, data, or 00041 profits; or business interruption) however caused and on any theory of 00042 liability, whether in contract, strict liability, or tort (including 00043 negligence or otherwise) arising in any way out of the use of this 00044 software, even if advised of the possibility of such damage. 00045 */ 00046 00047 #ifndef STLPLUS_CONTAINERS_FIXES 00048 #define STLPLUS_CONTAINERS_FIXES 00050 00051 // Author: Andy Rushton 00052 // Copyright: (c) Andy Rushton, 2007 00053 // License: BSD License, see ../docs/license.html 00054 00055 // Contains work arounds for OS or Compiler specific problems with container 00056 // templates 00057 00059 00061 // Unnecessary compiler warnings 00063 00064 #ifdef _MSC_VER 00065 // Microsoft Visual Studio 00066 // shut up the following irritating warnings 00067 // 4275 - VC6, exported class was derived from a class that was not exported 00068 // 4786 - VC6, identifier string exceeded maximum allowable length and was truncated (only affects debugger) 00069 // 4305 - VC6, identifier type was converted to a smaller type 00070 // 4503 - VC6, decorated name was longer than the maximum the compiler allows (only affects debugger) 00071 // 4309 - VC6, type conversion operation caused a constant to exceeded the space allocated for it 00072 // 4290 - VC6, C++ exception specification ignored 00073 // 4800 - VC6, forcing value to bool 'true' or 'false' (performance warning) 00074 // 4355 - VC6, 'this' : used in base member initializer list 00075 // 4675 - VC7.1, "change" in function overload resolution _might_ have altered program 00076 // 4996 - VC8, 'xxxx' was declared deprecated 00077 #pragma warning(disable: 4275 4786 4305 4503 4309 4290 4800 4355 4675 4996) 00078 #endif 00079 00080 #ifdef __BORLANDC__ 00081 // Borland 00082 // Shut up the following irritating warnings 00083 // 8008 - Condition is always true. 00084 // Whenever the compiler encounters a constant comparison that (due to 00085 // the nature of the value being compared) is always true or false, it 00086 // issues this warning and evaluates the condition at compile time. 00087 // 8060 - Possibly incorrect assignment. 00088 // This warning is generated when the compiler encounters an assignment 00089 // operator as the main operator of a conditional expression (part of 00090 // an if, while, or do-while statement). This is usually a 00091 // typographical error for the equality operator. 00092 // 8066 - Unreachable code. 00093 // A break, continue, goto, or return statement was not followed by a 00094 // label or the end of a loop or function. The compiler checks while, 00095 // do, and for loops with a constant test condition, and attempts to 00096 // recognize loops that can't fall through. 00097 #pragma warn -8008 00098 #pragma warn -8060 00099 #pragma warn -8066 00100 #endif 00101 00103 // Problems with the typename keyword 00105 00106 // There are problems with using the 'typename' keyword. Technically, if you 00107 // use a type member of a template class (i.e. a type declared within the 00108 // template class by a local typedef), you need to tell the compiler that it 00109 // is a type name. This is because the compiler cannot work out whether a 00110 // member is a type, a method or a data field at compile time. However, 00111 // support for the typename keyword has traditionally been incomplete in both 00112 // gcc and Visual Studio. I have used macros to try to resolve this issue. The 00113 // macros add the keyword for compiler versions that require it and omit it 00114 // for compiler versions that do not support it 00115 00116 // There are five places where typename keywords cause problems: 00117 // 00118 // 1) in a typedef where a template class's member type is being mapped onto 00119 // a type definition within another template class or function 00120 // e.g. template<typename T> fn () { 00121 // typedef typename someclass<T>::member_type local_type; 00122 // ^^^^^^^^ 00123 // 2) in a function parameter declaration, with similar rules to the above 00124 // e.g. template<typename T> fn (typename someclass<T>::member_type) 00125 // ^^^^^^^^ 00126 // 3) in instantiating a template, the parameter to the template, with similar rules to the above 00127 // e.g. template_class<typename someclass<T>::member_type> 00128 // ^^^^^^^^ 00129 // 4) Return expressions 00130 // e.g. return typename ntree<T>::const_iterator(this,m_root); 00131 // ^^^^^^^^ 00132 // 5) Creating temporary objects when passing arguments to a function or constructor 00133 // e.g. return typename ntree<T>::const_prefix_iterator(typename ntree<T>::const_iterator(this,m_root)); 00134 // ^^^^^^^^ 00135 // Note that the typename keyword is only required when the type being referred to is a member of a template class 00136 // 00137 // So far it *seems* as if all compilers either require all of them or none of 00138 // them, so this set of situations can be handled by a single macro 00139 00140 // default values, overridden for individual problem cases below 00141 #define TYPENAME typename 00142 00143 #ifdef __GNUC__ 00144 // GCC 00145 // - pre-version 3 didn't handle typename in any of these cases 00146 // - version 3 onwards, typename is required for all three cases as per default 00147 #if __GNUC__ < 3 00148 // gcc prior to v3 00149 #undef TYPENAME 00150 #define TYPENAME 00151 #endif 00152 #endif 00153 00154 #ifdef _MSC_VER 00155 // Visual Studio 00156 // - version 6 (compiler v.12) cannot handle typename in any of these cases 00157 // - version 7 (.NET) (compiler v.13) requires a typename in a parameter specification but supports all 00158 // - version 8 (2005) (compiler v.14) requires parameters and templates, supports all 00159 #if _MSC_VER < 1300 00160 // compiler version 12 and earlier 00161 #undef TYPENAME 00162 #define TYPENAME 00163 #endif 00164 #endif 00165 00167 #endif
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN: at Thu Feb 26 02:14:51 EST 2009 |