suffix.hpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. // Boost config.hpp configuration header file ------------------------------//
  2. // Copyright (c) 2001-2003 John Maddock
  3. // Copyright (c) 2001 Darin Adler
  4. // Copyright (c) 2001 Peter Dimov
  5. // Copyright (c) 2002 Bill Kempf
  6. // Copyright (c) 2002 Jens Maurer
  7. // Copyright (c) 2002-2003 David Abrahams
  8. // Copyright (c) 2003 Gennaro Prota
  9. // Copyright (c) 2003 Eric Friedman
  10. // Copyright (c) 2010 Eric Jourdanneau, Joel Falcou
  11. // Distributed under the Boost Software License, Version 1.0. (See
  12. // accompanying file LICENSE_1_0.txt or copy at
  13. // http://www.boost.org/LICENSE_1_0.txt)
  14. // See http://www.boost.org/ for most recent version.
  15. // Boost config.hpp policy and rationale documentation has been moved to
  16. // http://www.boost.org/libs/config/
  17. //
  18. // This file is intended to be stable, and relatively unchanging.
  19. // It should contain boilerplate code only - no compiler specific
  20. // code unless it is unavoidable - no changes unless unavoidable.
  21. #ifndef BOOST_CONFIG_SUFFIX_HPP
  22. #define BOOST_CONFIG_SUFFIX_HPP
  23. //
  24. // ensure that visibility macros are always defined, thus symplifying use
  25. //
  26. #ifndef BOOST_SYMBOL_EXPORT
  27. # define BOOST_SYMBOL_EXPORT
  28. #endif
  29. #ifndef BOOST_SYMBOL_IMPORT
  30. # define BOOST_SYMBOL_IMPORT
  31. #endif
  32. #ifndef BOOST_SYMBOL_VISIBLE
  33. # define BOOST_SYMBOL_VISIBLE
  34. #endif
  35. //
  36. // look for long long by looking for the appropriate macros in <limits.h>.
  37. // Note that we use limits.h rather than climits for maximal portability,
  38. // remember that since these just declare a bunch of macros, there should be
  39. // no namespace issues from this.
  40. //
  41. #if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_LONG_LONG) \
  42. && !defined(BOOST_MSVC) && !defined(__BORLANDC__)
  43. # include <limits.h>
  44. # if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
  45. # define BOOST_HAS_LONG_LONG
  46. # else
  47. # define BOOST_NO_LONG_LONG
  48. # endif
  49. #endif
  50. // GCC 3.x will clean up all of those nasty macro definitions that
  51. // BOOST_NO_CTYPE_FUNCTIONS is intended to help work around, so undefine
  52. // it under GCC 3.x.
  53. #if defined(__GNUC__) && (__GNUC__ >= 3) && defined(BOOST_NO_CTYPE_FUNCTIONS)
  54. # undef BOOST_NO_CTYPE_FUNCTIONS
  55. #endif
  56. //
  57. // Assume any extensions are in namespace std:: unless stated otherwise:
  58. //
  59. # ifndef BOOST_STD_EXTENSION_NAMESPACE
  60. # define BOOST_STD_EXTENSION_NAMESPACE std
  61. # endif
  62. //
  63. // If cv-qualified specializations are not allowed, then neither are cv-void ones:
  64. //
  65. # if defined(BOOST_NO_CV_SPECIALIZATIONS) \
  66. && !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS)
  67. # define BOOST_NO_CV_VOID_SPECIALIZATIONS
  68. # endif
  69. //
  70. // If there is no numeric_limits template, then it can't have any compile time
  71. // constants either!
  72. //
  73. # if defined(BOOST_NO_LIMITS) \
  74. && !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS)
  75. # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
  76. # define BOOST_NO_MS_INT64_NUMERIC_LIMITS
  77. # define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
  78. # endif
  79. //
  80. // if there is no long long then there is no specialisation
  81. // for numeric_limits<long long> either:
  82. //
  83. #if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_LONG_LONG_NUMERIC_LIMITS)
  84. # define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
  85. #endif
  86. //
  87. // Normalize BOOST_NO_STATIC_ASSERT and (depricated) BOOST_HAS_STATIC_ASSERT:
  88. //
  89. #if !defined(BOOST_NO_STATIC_ASSERT) && !defined(BOOST_HAS_STATIC_ASSERT)
  90. # define BOOST_HAS_STATIC_ASSERT
  91. #endif
  92. //
  93. // if there is no __int64 then there is no specialisation
  94. // for numeric_limits<__int64> either:
  95. //
  96. #if !defined(BOOST_HAS_MS_INT64) && !defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS)
  97. # define BOOST_NO_MS_INT64_NUMERIC_LIMITS
  98. #endif
  99. //
  100. // if member templates are supported then so is the
  101. // VC6 subset of member templates:
  102. //
  103. # if !defined(BOOST_NO_MEMBER_TEMPLATES) \
  104. && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
  105. # define BOOST_MSVC6_MEMBER_TEMPLATES
  106. # endif
  107. //
  108. // Without partial specialization, can't test for partial specialisation bugs:
  109. //
  110. # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
  111. && !defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG)
  112. # define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
  113. # endif
  114. //
  115. // Without partial specialization, we can't have array-type partial specialisations:
  116. //
  117. # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
  118. && !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
  119. # define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS
  120. # endif
  121. //
  122. // Without partial specialization, std::iterator_traits can't work:
  123. //
  124. # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
  125. && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
  126. # define BOOST_NO_STD_ITERATOR_TRAITS
  127. # endif
  128. //
  129. // Without partial specialization, partial
  130. // specialization with default args won't work either:
  131. //
  132. # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
  133. && !defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
  134. # define BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
  135. # endif
  136. //
  137. // Without member template support, we can't have template constructors
  138. // in the standard library either:
  139. //
  140. # if defined(BOOST_NO_MEMBER_TEMPLATES) \
  141. && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \
  142. && !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
  143. # define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
  144. # endif
  145. //
  146. // Without member template support, we can't have a conforming
  147. // std::allocator template either:
  148. //
  149. # if defined(BOOST_NO_MEMBER_TEMPLATES) \
  150. && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \
  151. && !defined(BOOST_NO_STD_ALLOCATOR)
  152. # define BOOST_NO_STD_ALLOCATOR
  153. # endif
  154. //
  155. // without ADL support then using declarations will break ADL as well:
  156. //
  157. #if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
  158. # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
  159. #endif
  160. //
  161. // Without typeid support we have no dynamic RTTI either:
  162. //
  163. #if defined(BOOST_NO_TYPEID) && !defined(BOOST_NO_RTTI)
  164. # define BOOST_NO_RTTI
  165. #endif
  166. //
  167. // If we have a standard allocator, then we have a partial one as well:
  168. //
  169. #if !defined(BOOST_NO_STD_ALLOCATOR)
  170. # define BOOST_HAS_PARTIAL_STD_ALLOCATOR
  171. #endif
  172. //
  173. // We can't have a working std::use_facet if there is no std::locale:
  174. //
  175. # if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_USE_FACET)
  176. # define BOOST_NO_STD_USE_FACET
  177. # endif
  178. //
  179. // We can't have a std::messages facet if there is no std::locale:
  180. //
  181. # if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_MESSAGES)
  182. # define BOOST_NO_STD_MESSAGES
  183. # endif
  184. //
  185. // We can't have a working std::wstreambuf if there is no std::locale:
  186. //
  187. # if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF)
  188. # define BOOST_NO_STD_WSTREAMBUF
  189. # endif
  190. //
  191. // We can't have a <cwctype> if there is no <cwchar>:
  192. //
  193. # if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_CWCTYPE)
  194. # define BOOST_NO_CWCTYPE
  195. # endif
  196. //
  197. // We can't have a swprintf if there is no <cwchar>:
  198. //
  199. # if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_SWPRINTF)
  200. # define BOOST_NO_SWPRINTF
  201. # endif
  202. //
  203. // If Win32 support is turned off, then we must turn off
  204. // threading support also, unless there is some other
  205. // thread API enabled:
  206. //
  207. #if defined(BOOST_DISABLE_WIN32) && defined(_WIN32) \
  208. && !defined(BOOST_DISABLE_THREADS) && !defined(BOOST_HAS_PTHREADS)
  209. # define BOOST_DISABLE_THREADS
  210. #endif
  211. //
  212. // Turn on threading support if the compiler thinks that it's in
  213. // multithreaded mode. We put this here because there are only a
  214. // limited number of macros that identify this (if there's any missing
  215. // from here then add to the appropriate compiler section):
  216. //
  217. #if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \
  218. || defined(_PTHREADS) || defined(__APPLE__) || defined(__DragonFly__)) \
  219. && !defined(BOOST_HAS_THREADS)
  220. # define BOOST_HAS_THREADS
  221. #endif
  222. //
  223. // Turn threading support off if BOOST_DISABLE_THREADS is defined:
  224. //
  225. #if defined(BOOST_DISABLE_THREADS) && defined(BOOST_HAS_THREADS)
  226. # undef BOOST_HAS_THREADS
  227. #endif
  228. //
  229. // Turn threading support off if we don't recognise the threading API:
  230. //
  231. #if defined(BOOST_HAS_THREADS) && !defined(BOOST_HAS_PTHREADS)\
  232. && !defined(BOOST_HAS_WINTHREADS) && !defined(BOOST_HAS_BETHREADS)\
  233. && !defined(BOOST_HAS_MPTASKS)
  234. # undef BOOST_HAS_THREADS
  235. #endif
  236. //
  237. // Turn threading detail macros off if we don't (want to) use threading
  238. //
  239. #ifndef BOOST_HAS_THREADS
  240. # undef BOOST_HAS_PTHREADS
  241. # undef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
  242. # undef BOOST_HAS_PTHREAD_YIELD
  243. # undef BOOST_HAS_PTHREAD_DELAY_NP
  244. # undef BOOST_HAS_WINTHREADS
  245. # undef BOOST_HAS_BETHREADS
  246. # undef BOOST_HAS_MPTASKS
  247. #endif
  248. //
  249. // If the compiler claims to be C99 conformant, then it had better
  250. // have a <stdint.h>:
  251. //
  252. # if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
  253. # define BOOST_HAS_STDINT_H
  254. # ifndef BOOST_HAS_LOG1P
  255. # define BOOST_HAS_LOG1P
  256. # endif
  257. # ifndef BOOST_HAS_EXPM1
  258. # define BOOST_HAS_EXPM1
  259. # endif
  260. # endif
  261. //
  262. // Define BOOST_NO_SLIST and BOOST_NO_HASH if required.
  263. // Note that this is for backwards compatibility only.
  264. //
  265. # if !defined(BOOST_HAS_SLIST) && !defined(BOOST_NO_SLIST)
  266. # define BOOST_NO_SLIST
  267. # endif
  268. # if !defined(BOOST_HAS_HASH) && !defined(BOOST_NO_HASH)
  269. # define BOOST_NO_HASH
  270. # endif
  271. //
  272. // Set BOOST_SLIST_HEADER if not set already:
  273. //
  274. #if defined(BOOST_HAS_SLIST) && !defined(BOOST_SLIST_HEADER)
  275. # define BOOST_SLIST_HEADER <slist>
  276. #endif
  277. //
  278. // Set BOOST_HASH_SET_HEADER if not set already:
  279. //
  280. #if defined(BOOST_HAS_HASH) && !defined(BOOST_HASH_SET_HEADER)
  281. # define BOOST_HASH_SET_HEADER <hash_set>
  282. #endif
  283. //
  284. // Set BOOST_HASH_MAP_HEADER if not set already:
  285. //
  286. #if defined(BOOST_HAS_HASH) && !defined(BOOST_HASH_MAP_HEADER)
  287. # define BOOST_HASH_MAP_HEADER <hash_map>
  288. #endif
  289. //
  290. // Set BOOST_NO_INITIALIZER_LISTS if there is no library support.
  291. //
  292. #if defined(BOOST_NO_0X_HDR_INITIALIZER_LIST) && !defined(BOOST_NO_INITIALIZER_LISTS)
  293. # define BOOST_NO_INITIALIZER_LISTS
  294. #endif
  295. //
  296. // Set BOOST_HAS_RVALUE_REFS when BOOST_NO_RVALUE_REFERENCES is not defined
  297. //
  298. #if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_HAS_RVALUE_REFS)
  299. #define BOOST_HAS_RVALUE_REFS
  300. #endif
  301. // BOOST_HAS_ABI_HEADERS
  302. // This macro gets set if we have headers that fix the ABI,
  303. // and prevent ODR violations when linking to external libraries:
  304. #if defined(BOOST_ABI_PREFIX) && defined(BOOST_ABI_SUFFIX) && !defined(BOOST_HAS_ABI_HEADERS)
  305. # define BOOST_HAS_ABI_HEADERS
  306. #endif
  307. #if defined(BOOST_HAS_ABI_HEADERS) && defined(BOOST_DISABLE_ABI_HEADERS)
  308. # undef BOOST_HAS_ABI_HEADERS
  309. #endif
  310. // BOOST_NO_STDC_NAMESPACE workaround --------------------------------------//
  311. // Because std::size_t usage is so common, even in boost headers which do not
  312. // otherwise use the C library, the <cstddef> workaround is included here so
  313. // that ugly workaround code need not appear in many other boost headers.
  314. // NOTE WELL: This is a workaround for non-conforming compilers; <cstddef>
  315. // must still be #included in the usual places so that <cstddef> inclusion
  316. // works as expected with standard conforming compilers. The resulting
  317. // double inclusion of <cstddef> is harmless.
  318. # ifdef BOOST_NO_STDC_NAMESPACE
  319. # include <cstddef>
  320. namespace std { using ::ptrdiff_t; using ::size_t; }
  321. # endif
  322. // Workaround for the unfortunate min/max macros defined by some platform headers
  323. #define BOOST_PREVENT_MACRO_SUBSTITUTION
  324. #ifndef BOOST_USING_STD_MIN
  325. # define BOOST_USING_STD_MIN() using std::min
  326. #endif
  327. #ifndef BOOST_USING_STD_MAX
  328. # define BOOST_USING_STD_MAX() using std::max
  329. #endif
  330. // BOOST_NO_STD_MIN_MAX workaround -----------------------------------------//
  331. # ifdef BOOST_NO_STD_MIN_MAX
  332. namespace std {
  333. template <class _Tp>
  334. inline const _Tp& min BOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a, const _Tp& __b) {
  335. return __b < __a ? __b : __a;
  336. }
  337. template <class _Tp>
  338. inline const _Tp& max BOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a, const _Tp& __b) {
  339. return __a < __b ? __b : __a;
  340. }
  341. }
  342. # endif
  343. // BOOST_STATIC_CONSTANT workaround --------------------------------------- //
  344. // On compilers which don't allow in-class initialization of static integral
  345. // constant members, we must use enums as a workaround if we want the constants
  346. // to be available at compile-time. This macro gives us a convenient way to
  347. // declare such constants.
  348. # ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
  349. # define BOOST_STATIC_CONSTANT(type, assignment) enum { assignment }
  350. # else
  351. # define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
  352. # endif
  353. // BOOST_USE_FACET / HAS_FACET workaround ----------------------------------//
  354. // When the standard library does not have a conforming std::use_facet there
  355. // are various workarounds available, but they differ from library to library.
  356. // The same problem occurs with has_facet.
  357. // These macros provide a consistent way to access a locale's facets.
  358. // Usage:
  359. // replace
  360. // std::use_facet<Type>(loc);
  361. // with
  362. // BOOST_USE_FACET(Type, loc);
  363. // Note do not add a std:: prefix to the front of BOOST_USE_FACET!
  364. // Use for BOOST_HAS_FACET is analogous.
  365. #if defined(BOOST_NO_STD_USE_FACET)
  366. # ifdef BOOST_HAS_TWO_ARG_USE_FACET
  367. # define BOOST_USE_FACET(Type, loc) std::use_facet(loc, static_cast<Type*>(0))
  368. # define BOOST_HAS_FACET(Type, loc) std::has_facet(loc, static_cast<Type*>(0))
  369. # elif defined(BOOST_HAS_MACRO_USE_FACET)
  370. # define BOOST_USE_FACET(Type, loc) std::_USE(loc, Type)
  371. # define BOOST_HAS_FACET(Type, loc) std::_HAS(loc, Type)
  372. # elif defined(BOOST_HAS_STLP_USE_FACET)
  373. # define BOOST_USE_FACET(Type, loc) (*std::_Use_facet<Type >(loc))
  374. # define BOOST_HAS_FACET(Type, loc) std::has_facet< Type >(loc)
  375. # endif
  376. #else
  377. # define BOOST_USE_FACET(Type, loc) std::use_facet< Type >(loc)
  378. # define BOOST_HAS_FACET(Type, loc) std::has_facet< Type >(loc)
  379. #endif
  380. // BOOST_NESTED_TEMPLATE workaround ------------------------------------------//
  381. // Member templates are supported by some compilers even though they can't use
  382. // the A::template member<U> syntax, as a workaround replace:
  383. //
  384. // typedef typename A::template rebind<U> binder;
  385. //
  386. // with:
  387. //
  388. // typedef typename A::BOOST_NESTED_TEMPLATE rebind<U> binder;
  389. #ifndef BOOST_NO_MEMBER_TEMPLATE_KEYWORD
  390. # define BOOST_NESTED_TEMPLATE template
  391. #else
  392. # define BOOST_NESTED_TEMPLATE
  393. #endif
  394. // BOOST_UNREACHABLE_RETURN(x) workaround -------------------------------------//
  395. // Normally evaluates to nothing, unless BOOST_NO_UNREACHABLE_RETURN_DETECTION
  396. // is defined, in which case it evaluates to return x; Use when you have a return
  397. // statement that can never be reached.
  398. #ifdef BOOST_NO_UNREACHABLE_RETURN_DETECTION
  399. # define BOOST_UNREACHABLE_RETURN(x) return x;
  400. #else
  401. # define BOOST_UNREACHABLE_RETURN(x)
  402. #endif
  403. // BOOST_DEDUCED_TYPENAME workaround ------------------------------------------//
  404. //
  405. // Some compilers don't support the use of `typename' for dependent
  406. // types in deduced contexts, e.g.
  407. //
  408. // template <class T> void f(T, typename T::type);
  409. // ^^^^^^^^
  410. // Replace these declarations with:
  411. //
  412. // template <class T> void f(T, BOOST_DEDUCED_TYPENAME T::type);
  413. #ifndef BOOST_NO_DEDUCED_TYPENAME
  414. # define BOOST_DEDUCED_TYPENAME typename
  415. #else
  416. # define BOOST_DEDUCED_TYPENAME
  417. #endif
  418. #ifndef BOOST_NO_TYPENAME_WITH_CTOR
  419. # define BOOST_CTOR_TYPENAME typename
  420. #else
  421. # define BOOST_CTOR_TYPENAME
  422. #endif
  423. // long long workaround ------------------------------------------//
  424. // On gcc (and maybe other compilers?) long long is alway supported
  425. // but it's use may generate either warnings (with -ansi), or errors
  426. // (with -pedantic -ansi) unless it's use is prefixed by __extension__
  427. //
  428. #if defined(BOOST_HAS_LONG_LONG)
  429. namespace boost{
  430. # ifdef __GNUC__
  431. __extension__ typedef long long long_long_type;
  432. __extension__ typedef unsigned long long ulong_long_type;
  433. # else
  434. typedef long long long_long_type;
  435. typedef unsigned long long ulong_long_type;
  436. # endif
  437. }
  438. #endif
  439. // BOOST_[APPEND_]EXPLICIT_TEMPLATE_[NON_]TYPE macros --------------------------//
  440. //
  441. // Some compilers have problems with function templates whose template
  442. // parameters don't appear in the function parameter list (basically
  443. // they just link one instantiation of the template in the final
  444. // executable). These macros provide a uniform way to cope with the
  445. // problem with no effects on the calling syntax.
  446. // Example:
  447. //
  448. // #include <iostream>
  449. // #include <ostream>
  450. // #include <typeinfo>
  451. //
  452. // template <int n>
  453. // void f() { std::cout << n << ' '; }
  454. //
  455. // template <typename T>
  456. // void g() { std::cout << typeid(T).name() << ' '; }
  457. //
  458. // int main() {
  459. // f<1>();
  460. // f<2>();
  461. //
  462. // g<int>();
  463. // g<double>();
  464. // }
  465. //
  466. // With VC++ 6.0 the output is:
  467. //
  468. // 2 2 double double
  469. //
  470. // To fix it, write
  471. //
  472. // template <int n>
  473. // void f(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, n)) { ... }
  474. //
  475. // template <typename T>
  476. // void g(BOOST_EXPLICIT_TEMPLATE_TYPE(T)) { ... }
  477. //
  478. #if defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
  479. # include "boost/type.hpp"
  480. # include "boost/non_type.hpp"
  481. # define BOOST_EXPLICIT_TEMPLATE_TYPE(t) boost::type<t>* = 0
  482. # define BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t) boost::type<t>*
  483. # define BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v) boost::non_type<t, v>* = 0
  484. # define BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) boost::non_type<t, v>*
  485. # define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) \
  486. , BOOST_EXPLICIT_TEMPLATE_TYPE(t)
  487. # define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) \
  488. , BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
  489. # define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) \
  490. , BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
  491. # define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) \
  492. , BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
  493. #else
  494. // no workaround needed: expand to nothing
  495. # define BOOST_EXPLICIT_TEMPLATE_TYPE(t)
  496. # define BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
  497. # define BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
  498. # define BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
  499. # define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t)
  500. # define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
  501. # define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
  502. # define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
  503. #endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
  504. // When BOOST_NO_STD_TYPEINFO is defined, we can just import
  505. // the global definition into std namespace:
  506. #ifdef BOOST_NO_STD_TYPEINFO
  507. #include <typeinfo>
  508. namespace std{ using ::typeinfo; }
  509. #endif
  510. // ---------------------------------------------------------------------------//
  511. //
  512. // Helper macro BOOST_STRINGIZE:
  513. // Converts the parameter X to a string after macro replacement
  514. // on X has been performed.
  515. //
  516. #define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
  517. #define BOOST_DO_STRINGIZE(X) #X
  518. //
  519. // Helper macro BOOST_JOIN:
  520. // The following piece of macro magic joins the two
  521. // arguments together, even when one of the arguments is
  522. // itself a macro (see 16.3.1 in C++ standard). The key
  523. // is that macro expansion of macro arguments does not
  524. // occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN.
  525. //
  526. #define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y )
  527. #define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y)
  528. #define BOOST_DO_JOIN2( X, Y ) X##Y
  529. //
  530. // Set some default values for compiler/library/platform names.
  531. // These are for debugging config setup only:
  532. //
  533. # ifndef BOOST_COMPILER
  534. # define BOOST_COMPILER "Unknown ISO C++ Compiler"
  535. # endif
  536. # ifndef BOOST_STDLIB
  537. # define BOOST_STDLIB "Unknown ISO standard library"
  538. # endif
  539. # ifndef BOOST_PLATFORM
  540. # if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) \
  541. || defined(_POSIX_SOURCE)
  542. # define BOOST_PLATFORM "Generic Unix"
  543. # else
  544. # define BOOST_PLATFORM "Unknown"
  545. # endif
  546. # endif
  547. //
  548. // Set some default values GPU support
  549. //
  550. # ifndef BOOST_GPU_ENABLED
  551. # define BOOST_GPU_ENABLED
  552. # endif
  553. #endif