instances.hpp 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. /*
  2. *
  3. * Copyright (c) 1998-2002
  4. * John Maddock
  5. *
  6. * Use, modification and distribution are subject to the
  7. * Boost Software License, Version 1.0. (See accompanying file
  8. * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. *
  10. */
  11. /*
  12. * LOCATION: see http://www.boost.org for most recent version.
  13. * FILE instances.cpp
  14. * VERSION see <boost/version.hpp>
  15. * DESCRIPTION: Defines those template instances that are placed in the
  16. * library rather than in the users object files.
  17. */
  18. //
  19. // note no include guard, we may include this multiple times:
  20. //
  21. #ifndef BOOST_REGEX_NO_EXTERNAL_TEMPLATES
  22. namespace boost{
  23. //
  24. // this header can be included multiple times, each time with
  25. // a different character type, BOOST_REGEX_CHAR_T must be defined
  26. // first:
  27. //
  28. #ifndef BOOST_REGEX_CHAR_T
  29. # error "BOOST_REGEX_CHAR_T not defined"
  30. #endif
  31. #ifndef BOOST_REGEX_TRAITS_T
  32. # define BOOST_REGEX_TRAITS_T , boost::regex_traits<BOOST_REGEX_CHAR_T >
  33. #endif
  34. //
  35. // what follows is compiler specific:
  36. //
  37. #if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
  38. #ifdef BOOST_HAS_ABI_HEADERS
  39. # include BOOST_ABI_PREFIX
  40. #endif
  41. # ifndef BOOST_REGEX_INSTANTIATE
  42. # pragma option push -Jgx
  43. # endif
  44. template class BOOST_REGEX_DECL basic_regex< BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >;
  45. template class BOOST_REGEX_DECL match_results< const BOOST_REGEX_CHAR_T* >;
  46. #ifndef BOOST_NO_STD_ALLOCATOR
  47. template class BOOST_REGEX_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
  48. #endif
  49. # ifndef BOOST_REGEX_INSTANTIATE
  50. # pragma option pop
  51. # endif
  52. #ifdef BOOST_HAS_ABI_HEADERS
  53. # include BOOST_ABI_SUFFIX
  54. #endif
  55. #elif defined(BOOST_MSVC) || defined(__ICL)
  56. # ifndef BOOST_REGEX_INSTANTIATE
  57. # ifdef __GNUC__
  58. # define template __extension__ extern template
  59. # else
  60. # if BOOST_MSVC > 1310
  61. # define BOOST_REGEX_TEMPLATE_DECL
  62. # endif
  63. # define template extern template
  64. # endif
  65. # endif
  66. #ifndef BOOST_REGEX_TEMPLATE_DECL
  67. # define BOOST_REGEX_TEMPLATE_DECL BOOST_REGEX_DECL
  68. #endif
  69. # ifdef BOOST_MSVC
  70. # pragma warning(push)
  71. # pragma warning(disable : 4251)
  72. #if BOOST_MSVC < 1700
  73. # pragma warning(disable : 4231)
  74. #endif
  75. # if BOOST_MSVC < 1600
  76. # pragma warning(disable : 4660)
  77. # endif
  78. # endif
  79. template class BOOST_REGEX_TEMPLATE_DECL basic_regex< BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >;
  80. template class BOOST_REGEX_TEMPLATE_DECL match_results< const BOOST_REGEX_CHAR_T* >;
  81. #ifndef BOOST_NO_STD_ALLOCATOR
  82. template class BOOST_REGEX_TEMPLATE_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
  83. #endif
  84. #if !(defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB <= 1))\
  85. && !(defined(BOOST_INTEL_CXX_VERSION) && (BOOST_INTEL_CXX_VERSION <= 800))\
  86. && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))\
  87. && !defined(BOOST_REGEX_ICU_INSTANCES)
  88. template class BOOST_REGEX_TEMPLATE_DECL match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >;
  89. #ifndef BOOST_NO_STD_ALLOCATOR
  90. template class BOOST_REGEX_TEMPLATE_DECL ::boost::BOOST_REGEX_DETAIL_NS::perl_matcher< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >;
  91. #endif
  92. #endif
  93. # ifdef BOOST_MSVC
  94. # pragma warning(pop)
  95. # endif
  96. # ifdef template
  97. # undef template
  98. # endif
  99. #undef BOOST_REGEX_TEMPLATE_DECL
  100. #elif (defined(__GNUC__) && (__GNUC__ >= 3)) || !defined(BOOST_NO_CXX11_EXTERN_TEMPLATE)
  101. #if defined(__clang__)
  102. # pragma clang diagnostic push
  103. # if defined(__APPLE_CC__)
  104. # if (__clang_major__ > 6)
  105. # pragma clang diagnostic ignored "-Wkeyword-macro"
  106. # endif
  107. # else
  108. # if (__clang_major__ > 3) || ((__clang_major__ == 3) && (__clang_minor__ > 5))
  109. # pragma clang diagnostic ignored "-Wkeyword-macro"
  110. # endif
  111. # endif
  112. #endif
  113. # ifndef BOOST_REGEX_INSTANTIATE
  114. # ifdef __GNUC__
  115. # define template __extension__ extern template
  116. # else
  117. # define template extern template
  118. # endif
  119. # endif
  120. #if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_REGEX_ICU_INSTANCES)
  121. namespace BOOST_REGEX_DETAIL_NS{
  122. template BOOST_REGEX_DECL
  123. std::locale cpp_regex_traits_base<BOOST_REGEX_CHAR_T>::imbue(const std::locale& l);
  124. template BOOST_REGEX_DECL
  125. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::string_type
  126. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::transform_primary(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
  127. template BOOST_REGEX_DECL
  128. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::string_type
  129. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::transform(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
  130. template BOOST_REGEX_DECL
  131. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::string_type
  132. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::lookup_collatename(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
  133. template BOOST_REGEX_DECL
  134. void cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::init();
  135. template BOOST_REGEX_DECL
  136. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::char_class_type
  137. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::lookup_classname_imp(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
  138. #ifdef BOOST_REGEX_BUGGY_CTYPE_FACET
  139. template BOOST_REGEX_DECL
  140. bool cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::isctype(const BOOST_REGEX_CHAR_T c, char_class_type mask) const;
  141. #endif
  142. } // namespace
  143. template BOOST_REGEX_DECL
  144. boost::intmax_t cpp_regex_traits<BOOST_REGEX_CHAR_T>::toi(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last, int radix)const;
  145. template BOOST_REGEX_DECL
  146. std::string cpp_regex_traits<BOOST_REGEX_CHAR_T>::catalog_name(const std::string& name);
  147. template BOOST_REGEX_DECL
  148. std::string& cpp_regex_traits<BOOST_REGEX_CHAR_T>::get_catalog_name_inst();
  149. template BOOST_REGEX_DECL
  150. std::string cpp_regex_traits<BOOST_REGEX_CHAR_T>::get_catalog_name();
  151. #ifdef BOOST_HAS_THREADS
  152. template BOOST_REGEX_DECL
  153. static_mutex& cpp_regex_traits<BOOST_REGEX_CHAR_T>::get_mutex_inst();
  154. #endif
  155. #endif
  156. template BOOST_REGEX_DECL basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >&
  157. basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >::do_assign(
  158. const BOOST_REGEX_CHAR_T* p1,
  159. const BOOST_REGEX_CHAR_T* p2,
  160. flag_type f);
  161. template BOOST_REGEX_DECL basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >::locale_type BOOST_REGEX_CALL
  162. basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >::imbue(locale_type l);
  163. template BOOST_REGEX_DECL void BOOST_REGEX_CALL
  164. match_results<const BOOST_REGEX_CHAR_T*>::maybe_assign(
  165. const match_results<const BOOST_REGEX_CHAR_T*>& m);
  166. namespace BOOST_REGEX_DETAIL_NS{
  167. template BOOST_REGEX_DECL void perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >::construct_init(
  168. const basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >& e, match_flag_type f);
  169. template BOOST_REGEX_DECL bool perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >::match();
  170. template BOOST_REGEX_DECL bool perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >::find();
  171. } // namespace
  172. #if (defined(__GLIBCPP__) || defined(__GLIBCXX__)) \
  173. && !defined(BOOST_REGEX_ICU_INSTANCES)\
  174. && !defined(__SGI_STL_PORT)\
  175. && !defined(_STLPORT_VERSION)
  176. // std:basic_string<>::const_iterator instances as well:
  177. template BOOST_REGEX_DECL void BOOST_REGEX_CALL
  178. match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>::maybe_assign(
  179. const match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>& m);
  180. namespace BOOST_REGEX_DETAIL_NS{
  181. template BOOST_REGEX_DECL void perl_matcher<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >::construct_init(
  182. const basic_regex<BOOST_REGEX_CHAR_T>& e, match_flag_type f);
  183. template BOOST_REGEX_DECL bool perl_matcher<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >::match();
  184. template BOOST_REGEX_DECL bool perl_matcher<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >::allocator_type, boost::regex_traits<BOOST_REGEX_CHAR_T > >::find();
  185. } // namespace
  186. #endif
  187. # ifdef template
  188. # undef template
  189. # endif
  190. #ifdef __clang__
  191. #pragma clang diagnostic pop
  192. #endif
  193. #endif
  194. } // namespace boost
  195. #endif // BOOST_REGEX_NO_EXTERNAL_TEMPLATES