std_set.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*-----------------------------------------------------------------------------+
  2. Copyright (c) 2007-2010: Joachim Faulhaber
  3. +------------------------------------------------------------------------------+
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENCE.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. +-----------------------------------------------------------------------------*/
  8. #ifndef BOOST_ICL_DETAIL_STD_SET_HPP_JOFA_101007
  9. #define BOOST_ICL_DETAIL_STD_SET_HPP_JOFA_101007
  10. #include <set>
  11. #include <boost/config.hpp>
  12. #include <boost/icl/type_traits/type_to_string.hpp>
  13. #include <boost/icl/type_traits/is_set.hpp>
  14. namespace boost{namespace icl
  15. {
  16. template <class Type>
  17. struct is_set<std::set<Type> >
  18. {
  19. typedef is_set<std::set<Type> > type;
  20. BOOST_STATIC_CONSTANT(bool, value = true);
  21. };
  22. template <class Type>
  23. struct type_to_string<std::set<Type> >
  24. {
  25. static std::string apply()
  26. { return "set<"+ type_to_string<Type>::apply() +">"; }
  27. };
  28. template <class Type>
  29. struct type_to_string<std::set<Type, std::greater<Type> > >
  30. {
  31. static std::string apply()
  32. { return "set<"+ type_to_string<Type>::apply() +" g>"; }
  33. };
  34. }} // namespace icl boost
  35. #endif // BOOST_ICL_DETAIL_STD_SET_HPP_JOFA_101007