diff options
author | Brad King <brad.king@kitware.com> | 2005-03-29 15:10:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2005-03-29 15:10:25 (GMT) |
commit | 65f1e3e1d8a69a9af7744034123fab36c356db1e (patch) | |
tree | 874504a014ab095148695ebafacc5462c2a697d6 /Source/kwsys/kwsys_stl_string.hxx.in | |
parent | 22f6d68be3e6630b21bb17de63273965de44ee45 (diff) | |
download | CMake-65f1e3e1d8a69a9af7744034123fab36c356db1e.zip CMake-65f1e3e1d8a69a9af7744034123fab36c356db1e.tar.gz CMake-65f1e3e1d8a69a9af7744034123fab36c356db1e.tar.bz2 |
ENH: Added operator!= for stl string and char* when the system does not provide one.
Diffstat (limited to 'Source/kwsys/kwsys_stl_string.hxx.in')
-rw-r--r-- | Source/kwsys/kwsys_stl_string.hxx.in | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/kwsys/kwsys_stl_string.hxx.in b/Source/kwsys/kwsys_stl_string.hxx.in index 7d45649..2061c18 100644 --- a/Source/kwsys/kwsys_stl_string.hxx.in +++ b/Source/kwsys/kwsys_stl_string.hxx.in @@ -90,3 +90,22 @@ operator<<(@KWSYS_NAMESPACE@_ios::ostream& os, return os << s.c_str(); } #endif + +// Provide the operator!= for the stl string and char* if it is not +// provided by the system or another copy of kwsys. Allow user code +// to block this definition by defining the macro +// @KWSYS_NAMESPACE@_STL_STRING_NO_NEQ_CHAR +// to avoid conflicts with other libraries. +#if !@KWSYS_NAMESPACE@_STL_STRING_HAVE_NEQ_CHAR && \ + !defined(@KWSYS_NAMESPACE@_STL_STRING_NO_NEQ_CHAR) && \ + !defined(KWSYS_STL_STRING_NEQ_CHAR_DEFINED) +# define KWSYS_STL_STRING_NEQ_CHAR_DEFINED +inline bool operator!=(@KWSYS_NAMESPACE@_stl::string const& s, const char* c) +{ + return !(s == c); +} +inline bool operator!=(const char* c, @KWSYS_NAMESPACE@_stl::string const& s) +{ + return !(s == c); +} +#endif |