/Src/Dependencies/Boost/boost/spirit/home/karma/detail/unused_delimiter.hpp

http://hadesmem.googlecode.com/ · C++ Header · 51 lines · 31 code · 9 blank · 11 comment · 0 complexity · 115e7d4e22108b95b958d570f29347eb MD5 · raw file

  1. // Copyright (c) 2001-2011 Hartmut Kaiser
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #if !defined(BOOST_SPIRIT_KARMA_UNUSED_DELIMITER_MAR_15_2009_0923PM)
  6. #define BOOST_SPIRIT_KARMA_UNUSED_DELIMITER_MAR_15_2009_0923PM
  7. #if defined(_MSC_VER)
  8. #pragma once
  9. #endif
  10. #include <boost/spirit/home/support/unused.hpp>
  11. namespace boost { namespace spirit { namespace karma { namespace detail
  12. {
  13. template <typename Delimiter>
  14. struct unused_delimiter : unused_type
  15. {
  16. unused_delimiter(Delimiter const& delim)
  17. : delimiter(delim) {}
  18. Delimiter const& delimiter;
  19. private:
  20. // silence MSVC warning C4512: assignment operator could not be generated
  21. unused_delimiter& operator= (unused_delimiter const&);
  22. };
  23. // If a surrounding verbatim[] directive was specified, the current
  24. // delimiter is of the type unused_delimiter. In this case we
  25. // re-activate the delimiter which was active before the verbatim[]
  26. // directive.
  27. template <typename Delimiter, typename Default>
  28. inline Delimiter const&
  29. get_delimiter(unused_delimiter<Delimiter> const& u, Default const&)
  30. {
  31. return u.delimiter;
  32. }
  33. // If no surrounding verbatim[] directive was specified we activate
  34. // a single space as the delimiter to use.
  35. template <typename Delimiter, typename Default>
  36. inline Default const&
  37. get_delimiter(Delimiter const&, Default const& d)
  38. {
  39. return d;
  40. }
  41. }}}}
  42. #endif