msvc_dtw.hpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Copyright Aleksey Gurtovoy 2000-2004
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/mpl for documentation.
  8. // $Id$
  9. // $Date$
  10. // $Revision$
  11. // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION!
  12. #include <boost/mpl/aux_/preprocessor/params.hpp>
  13. // local macros, #undef-ined at the end of the header
  14. #define AUX778076_DTW_PARAMS(param) \
  15. BOOST_MPL_PP_PARAMS(AUX778076_MSVC_DTW_ARITY, param) \
  16. /**/
  17. #define AUX778076_DTW_ORIGINAL_NAME \
  18. AUX778076_MSVC_DTW_ORIGINAL_NAME \
  19. /**/
  20. // warning: not a well-formed C++
  21. // workaround for MSVC 6.5's "dependent template typedef bug"
  22. template< typename F>
  23. struct AUX778076_MSVC_DTW_NAME
  24. {
  25. template< bool > struct f_ : F {};
  26. template<> struct f_<true>
  27. {
  28. #if AUX778076_MSVC_DTW_ARITY > 0
  29. template< AUX778076_DTW_PARAMS(typename P) > struct AUX778076_DTW_ORIGINAL_NAME
  30. {
  31. typedef int type;
  32. };
  33. };
  34. template< AUX778076_DTW_PARAMS(typename T) > struct result_
  35. : f_< aux::msvc_never_true<F>::value >
  36. ::template AUX778076_DTW_ORIGINAL_NAME< AUX778076_DTW_PARAMS(T) >
  37. {
  38. };
  39. #else
  40. template< typename P = int > struct AUX778076_DTW_ORIGINAL_NAME
  41. {
  42. typedef int type;
  43. };
  44. };
  45. template< typename T = int > struct result_
  46. : f_< aux::msvc_never_true<F>::value >
  47. ::template AUX778076_DTW_ORIGINAL_NAME<>
  48. {
  49. };
  50. #endif
  51. };
  52. #undef AUX778076_DTW_ORIGINAL_NAME
  53. #undef AUX778076_DTW_PARAMS
  54. #undef AUX778076_MSVC_DTW_NAME
  55. #undef AUX778076_MSVC_DTW_ORIGINAL_NAME
  56. #undef AUX778076_MSVC_DTW_ARITY