instances.hpp 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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::re_detail::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 4231 4660)
  72. # endif
  73. template class BOOST_REGEX_TEMPLATE_DECL basic_regex< BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >;
  74. #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
  75. template class BOOST_REGEX_TEMPLATE_DECL match_results< const BOOST_REGEX_CHAR_T* >;
  76. #endif
  77. #ifndef BOOST_NO_STD_ALLOCATOR
  78. template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher<BOOST_REGEX_CHAR_T const *, match_results< const BOOST_REGEX_CHAR_T* >::allocator_type BOOST_REGEX_TRAITS_T >;
  79. #endif
  80. #if !(defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB <= 1))\
  81. && !(defined(BOOST_INTEL_CXX_VERSION) && (BOOST_INTEL_CXX_VERSION <= 800))\
  82. && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))\
  83. && !defined(BOOST_REGEX_ICU_INSTANCES)
  84. #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
  85. template class BOOST_REGEX_TEMPLATE_DECL match_results< std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator >;
  86. #endif
  87. #ifndef BOOST_NO_STD_ALLOCATOR
  88. template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::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 > >;
  89. #endif
  90. #endif
  91. # ifdef BOOST_MSVC
  92. # pragma warning(pop)
  93. # endif
  94. # ifdef template
  95. # undef template
  96. # endif
  97. #undef BOOST_REGEX_TEMPLATE_DECL
  98. #elif (defined(__GNUC__) && (__GNUC__ >= 3))
  99. # ifndef BOOST_REGEX_INSTANTIATE
  100. # define template __extension__ extern template
  101. # endif
  102. #if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_REGEX_ICU_INSTANCES)
  103. namespace re_detail{
  104. template BOOST_REGEX_DECL
  105. std::locale cpp_regex_traits_base<BOOST_REGEX_CHAR_T>::imbue(const std::locale& l);
  106. template BOOST_REGEX_DECL
  107. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::string_type
  108. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::transform_primary(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
  109. template BOOST_REGEX_DECL
  110. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::string_type
  111. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::transform(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
  112. template BOOST_REGEX_DECL
  113. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::string_type
  114. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::lookup_collatename(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
  115. template BOOST_REGEX_DECL
  116. void cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::init();
  117. template BOOST_REGEX_DECL
  118. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::char_class_type
  119. cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::lookup_classname_imp(const BOOST_REGEX_CHAR_T* p1, const BOOST_REGEX_CHAR_T* p2) const;
  120. #ifdef BOOST_REGEX_BUGGY_CTYPE_FACET
  121. template BOOST_REGEX_DECL
  122. bool cpp_regex_traits_implementation<BOOST_REGEX_CHAR_T>::isctype(const BOOST_REGEX_CHAR_T c, char_class_type mask) const;
  123. #endif
  124. } // namespace
  125. template BOOST_REGEX_DECL
  126. int cpp_regex_traits<BOOST_REGEX_CHAR_T>::toi(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last, int radix)const;
  127. template BOOST_REGEX_DECL
  128. std::string cpp_regex_traits<BOOST_REGEX_CHAR_T>::catalog_name(const std::string& name);
  129. template BOOST_REGEX_DECL
  130. std::string& cpp_regex_traits<BOOST_REGEX_CHAR_T>::get_catalog_name_inst();
  131. template BOOST_REGEX_DECL
  132. std::string cpp_regex_traits<BOOST_REGEX_CHAR_T>::get_catalog_name();
  133. #ifdef BOOST_HAS_THREADS
  134. template BOOST_REGEX_DECL
  135. static_mutex& cpp_regex_traits<BOOST_REGEX_CHAR_T>::get_mutex_inst();
  136. #endif
  137. #endif
  138. template BOOST_REGEX_DECL basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >&
  139. basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >::do_assign(
  140. const BOOST_REGEX_CHAR_T* p1,
  141. const BOOST_REGEX_CHAR_T* p2,
  142. flag_type f);
  143. template BOOST_REGEX_DECL basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >::locale_type BOOST_REGEX_CALL
  144. basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >::imbue(locale_type l);
  145. template BOOST_REGEX_DECL void BOOST_REGEX_CALL
  146. match_results<const BOOST_REGEX_CHAR_T*>::maybe_assign(
  147. const match_results<const BOOST_REGEX_CHAR_T*>& m);
  148. namespace re_detail{
  149. 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(
  150. const basic_regex<BOOST_REGEX_CHAR_T BOOST_REGEX_TRAITS_T >& e, match_flag_type f);
  151. 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();
  152. 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();
  153. } // namespace
  154. #if (defined(__GLIBCPP__) || defined(__GLIBCXX__)) \
  155. && !defined(BOOST_REGEX_ICU_INSTANCES)\
  156. && !defined(__SGI_STL_PORT)\
  157. && !defined(_STLPORT_VERSION)
  158. // std:basic_string<>::const_iterator instances as well:
  159. template BOOST_REGEX_DECL void BOOST_REGEX_CALL
  160. match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>::maybe_assign(
  161. const match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>& m);
  162. namespace re_detail{
  163. 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(
  164. const basic_regex<BOOST_REGEX_CHAR_T>& e, match_flag_type f);
  165. 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();
  166. 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();
  167. } // namespace
  168. #endif
  169. # ifdef template
  170. # undef template
  171. # endif
  172. #endif
  173. } // namespace boost
  174. #endif // BOOST_REGEX_NO_EXTERNAL_TEMPLATES