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.

152 lines
5.6 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: stlsoft/meta/capabilities.hpp
  3. *
  4. * Purpose: Pre-processor abilities for the meta library.
  5. *
  6. * Created: 5th March 2006
  7. * Updated: 10th August 2009
  8. *
  9. * Home: http://stlsoft.org/
  10. *
  11. * Copyright (c) 2006-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/meta/capabilities.hpp
  40. *
  41. * \brief [C++ only] Pre-processor discrimination of meta programming
  42. * support
  43. * (\ref group__library__meta "Template Meta-programming" Library).
  44. */
  45. #ifndef STLSOFT_INCL_STLSOFT_META_HPP_CAPABILITIES
  46. #define STLSOFT_INCL_STLSOFT_META_HPP_CAPABILITIES
  47. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  48. # define STLSOFT_VER_STLSOFT_META_HPP_CAPABILITIES_MAJOR 1
  49. # define STLSOFT_VER_STLSOFT_META_HPP_CAPABILITIES_MINOR 1
  50. # define STLSOFT_VER_STLSOFT_META_HPP_CAPABILITIES_REVISION 1
  51. # define STLSOFT_VER_STLSOFT_META_HPP_CAPABILITIES_EDIT 11
  52. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  53. /* /////////////////////////////////////////////////////////////////////////
  54. * Includes
  55. */
  56. #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
  57. # include <stlsoft/stlsoft.h>
  58. #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
  59. /* /////////////////////////////////////////////////////////////////////////
  60. * Capabilities
  61. */
  62. /** \def STLSOFT_META_HAS_IS_SAME_TYPE
  63. *
  64. * \ingroup group__library__meta
  65. *
  66. * \brief If defined, this indicates that the <code>stlsoft::is_same_type</code>
  67. * is supported <code>and stlsoft/meta/is_same_type.hpp</code> can be included.
  68. */
  69. #ifdef STLSOFT_META_HAS_IS_SAME_TYPE
  70. # undef STLSOFT_META_HAS_IS_SAME_TYPE
  71. #endif /* STLSOFT_META_HAS_IS_SAME_TYPE */
  72. #if defined(STLSOFT_DOCUMENTATION_SKIP_SECTION) || \
  73. defined(STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT)
  74. // If partial template specialisation is supported, then is_same_type is
  75. // supported ...
  76. # define STLSOFT_META_HAS_IS_SAME_TYPE
  77. # if defined(STLSOFT_COMPILER_IS_MSVC) && \
  78. _MSC_VER < 1200
  79. // . . . except if it's Visual C++ 5.0 or earlier.
  80. # define STLSOFT_META_HAS_IS_SAME_TYPE
  81. # endif /* compiler */
  82. #endif /* STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT */
  83. /** \def STLSOFT_META_HAS_SELECT_FIRST_TYPE_IF
  84. *
  85. * \ingroup group__library__meta
  86. *
  87. * \brief If defined, this indicates that the <code>stlsoft::select_first_type_if</code>
  88. * is supported <code>and stlsoft/meta/select_first_type_if.hpp</code> can be included.
  89. */
  90. #ifdef STLSOFT_META_HAS_SELECT_FIRST_TYPE_IF
  91. # undef STLSOFT_META_HAS_SELECT_FIRST_TYPE_IF
  92. #endif /* STLSOFT_META_HAS_SELECT_FIRST_TYPE_IF */
  93. #if defined(STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT)
  94. // If partial template specialisation is supported, then select_first_type_if is
  95. // supported ...
  96. # define STLSOFT_META_HAS_SELECT_FIRST_TYPE_IF
  97. # if defined(STLSOFT_COMPILER_IS_MSVC) && \
  98. _MSC_VER < 1200
  99. // . . . except if it's Visual C++ 5.0 or earlier.
  100. # define STLSOFT_META_HAS_SELECT_FIRST_TYPE_IF
  101. # endif /* compiler */
  102. #endif /* STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT */
  103. /** \def STLSOFT_META_HAS_MEMBER_TYPE_DETECTION
  104. *
  105. * \ingroup group__library__meta
  106. *
  107. * \brief If defined, this indicates that the member type detection is
  108. * supported.
  109. */
  110. #ifdef STLSOFT_META_HAS_MEMBER_TYPE_DETECTION
  111. # undef STLSOFT_META_HAS_MEMBER_TYPE_DETECTION
  112. #endif /* STLSOFT_META_HAS_MEMBER_TYPE_DETECTION */
  113. #ifdef STLSOFT_CF_HAS_MEMBER_TYPE_SUPPORTED
  114. # undef STLSOFT_CF_HAS_MEMBER_TYPE_SUPPORTED
  115. #endif /* STLSOFT_CF_HAS_MEMBER_TYPE_SUPPORTED */
  116. #if !defined(STLSOFT_COMPILER_IS_BORLAND) && \
  117. ( !defined(STLSOFT_COMPILER_IS_DMC) || \
  118. __DMC__ >= 0x0845) && \
  119. ( !defined(STLSOFT_COMPILER_IS_MSVC) || \
  120. _MSC_VER >= 1310) && \
  121. !defined(STLSOFT_COMPILER_IS_VECTORC) && \
  122. !defined(STLSOFT_COMPILER_IS_WATCOM)
  123. # define STLSOFT_META_HAS_MEMBER_TYPE_DETECTION
  124. # define STLSOFT_CF_HAS_MEMBER_TYPE_SUPPORTED
  125. #endif /* compiler */
  126. /* ////////////////////////////////////////////////////////////////////// */
  127. #endif /* !STLSOFT_INCL_STLSOFT_META_HPP_CAPABILITIES */
  128. /* ///////////////////////////// end of file //////////////////////////// */