You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
4.7 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: stlsoft/util/inert.hpp
  3. *
  4. * Purpose: Contains the inert class.
  5. *
  6. * Created: 16th January 2002
  7. * Updated: 10th August 2009
  8. *
  9. * Home: http://stlsoft.org/
  10. *
  11. * Copyright (c) 2002-2009, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are met:
  16. *
  17. * - Redistributions of source code must retain the above copyright notice, this
  18. * list of conditions and the following disclaimer.
  19. * - Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
  23. * any contributors may be used to endorse or promote products derived from
  24. * this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  27. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  30. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  31. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  32. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  33. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  34. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  35. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  36. * POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. * ////////////////////////////////////////////////////////////////////// */
  39. /** \file stlsoft/util/inert.hpp
  40. *
  41. * \brief [C++ only] Definition of the stlsoft::inert class
  42. * (\ref group__library__utility "Utility" Library).
  43. */
  44. #ifndef STLSOFT_INCL_STLSOFT_UTIL_HPP_INERT
  45. #define STLSOFT_INCL_STLSOFT_UTIL_HPP_INERT
  46. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  47. # define STLSOFT_VER_STLSOFT_UTIL_HPP_INERT_MAJOR 4
  48. # define STLSOFT_VER_STLSOFT_UTIL_HPP_INERT_MINOR 0
  49. # define STLSOFT_VER_STLSOFT_UTIL_HPP_INERT_REVISION 3
  50. # define STLSOFT_VER_STLSOFT_UTIL_HPP_INERT_EDIT 40
  51. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  52. /* /////////////////////////////////////////////////////////////////////////
  53. * Compatibility
  54. */
  55. /*
  56. [<[STLSOFT-AUTO:NO-DOCFILELABEL]>]
  57. [<[STLSOFT-AUTO:NO-UNITTEST]>]
  58. */
  59. /* /////////////////////////////////////////////////////////////////////////
  60. * Includes
  61. */
  62. #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
  63. # include <stlsoft/stlsoft.h>
  64. #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
  65. /* /////////////////////////////////////////////////////////////////////////
  66. * Namespace
  67. */
  68. #ifndef _STLSOFT_NO_NAMESPACE
  69. namespace stlsoft
  70. {
  71. #endif /* _STLSOFT_NO_NAMESPACE */
  72. /* /////////////////////////////////////////////////////////////////////////
  73. * Classes
  74. */
  75. /** \brief This class is almost completely unusable, and is used as a placeholder or as
  76. * a name remover
  77. *
  78. * \ingroup group__library__utility
  79. */
  80. // class inert
  81. class inert
  82. {
  83. // Construction
  84. public:
  85. /// Default constructor
  86. inert()
  87. {}
  88. /// Destructor
  89. ~inert() stlsoft_throw_0()
  90. {}
  91. // Not to be implemented
  92. private:
  93. inert(inert const& rhs);
  94. inert const& operator =(inert const& rhs);
  95. #ifndef new
  96. void *operator new(ss_size_t ) stlsoft_throw_0()
  97. {
  98. return 0;
  99. }
  100. void operator delete(void*)
  101. {}
  102. #endif /* !new */
  103. int operator !() const;
  104. #ifdef STLSOFT_CF_NATIVE_BOOL_SUPPORT
  105. operator bool() const;
  106. #endif /* STLSOFT_CF_NATIVE_BOOL_SUPPORT */
  107. operator void *() const;
  108. void *operator &() const;
  109. #if defined(STLSOFT_COMPILER_IS_GCC) || \
  110. defined(STLSOFT_COMPILER_IS_INTEL) || \
  111. defined(STLSOFT_COMPILER_IS_WATCOM)
  112. struct _{};
  113. _ *operator ->() const;
  114. #else /* ? compiler */
  115. struct {} *operator ->() const;
  116. #endif /* compiler */
  117. #ifdef STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT
  118. template <ss_typename_param_k T>
  119. operator T &();
  120. template <ss_typename_param_k T>
  121. operator T const& () const;
  122. #endif /* STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT */
  123. };
  124. /* ////////////////////////////////////////////////////////////////////// */
  125. #ifndef _STLSOFT_NO_NAMESPACE
  126. } // namespace stlsoft
  127. #endif /* _STLSOFT_NO_NAMESPACE */
  128. /* ////////////////////////////////////////////////////////////////////// */
  129. #endif /* !STLSOFT_INCL_STLSOFT_UTIL_HPP_INERT */
  130. /* ///////////////////////////// end of file //////////////////////////// */