templated_streams.hpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //-----------------------------------------------------------------------------
  2. // boost detail/templated_streams.hpp header file
  3. // See http://www.boost.org for updates, documentation, and revision history.
  4. //-----------------------------------------------------------------------------
  5. //
  6. // Copyright (c) 2003
  7. // Eric Friedman
  8. //
  9. // Distributed under the Boost Software License, Version 1.0. (See
  10. // accompanying file LICENSE_1_0.txt or copy at
  11. // http://www.boost.org/LICENSE_1_0.txt)
  12. #ifndef BOOST_DETAIL_TEMPLATED_STREAMS_HPP
  13. #define BOOST_DETAIL_TEMPLATED_STREAMS_HPP
  14. #include "boost/config.hpp"
  15. ///////////////////////////////////////////////////////////////////////////////
  16. // (detail) BOOST_TEMPLATED_STREAM_* macros
  17. //
  18. // Provides workaround platforms without stream class templates.
  19. //
  20. #if !defined(BOOST_NO_STD_LOCALE)
  21. #define BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) \
  22. template < typename E , typename T >
  23. #define BOOST_TEMPLATED_STREAM_TEMPLATE_ALLOC(E,T,A) \
  24. template < typename E , typename T , typename A >
  25. #define BOOST_TEMPLATED_STREAM_ARGS(E,T) \
  26. typename E , typename T
  27. #define BOOST_TEMPLATED_STREAM_ARGS_ALLOC(E,T,A) \
  28. typename E , typename T , typename A
  29. #define BOOST_TEMPLATED_STREAM_COMMA ,
  30. #define BOOST_TEMPLATED_STREAM_ELEM(E) E
  31. #define BOOST_TEMPLATED_STREAM_TRAITS(T) T
  32. #define BOOST_TEMPLATED_STREAM_ALLOC(A) A
  33. #define BOOST_TEMPLATED_STREAM(X,E,T) \
  34. BOOST_JOIN(std::basic_,X)< E , T >
  35. #define BOOST_TEMPLATED_STREAM_WITH_ALLOC(X,E,T,A) \
  36. BOOST_JOIN(std::basic_,X)< E , T , A >
  37. #else // defined(BOOST_NO_STD_LOCALE)
  38. #define BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) /**/
  39. #define BOOST_TEMPLATED_STREAM_TEMPLATE_ALLOC(E,T,A) /**/
  40. #define BOOST_TEMPLATED_STREAM_ARGS(E,T) /**/
  41. #define BOOST_TEMPLATED_STREAM_ARGS_ALLOC(E,T,A) /**/
  42. #define BOOST_TEMPLATED_STREAM_COMMA /**/
  43. #define BOOST_TEMPLATED_STREAM_ELEM(E) char
  44. #define BOOST_TEMPLATED_STREAM_TRAITS(T) std::char_traits<char>
  45. #define BOOST_TEMPLATED_STREAM_ALLOC(A) std::allocator<char>
  46. #define BOOST_TEMPLATED_STREAM(X,E,T) \
  47. std::X
  48. #define BOOST_TEMPLATED_STREAM_WITH_ALLOC(X,E,T,A) \
  49. std::X
  50. #endif // BOOST_NO_STD_LOCALE
  51. #endif // BOOST_DETAIL_TEMPLATED_STREAMS_HPP