extension.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*=============================================================================
  2. Copyright (c) 2001-2009 Joel de Guzman
  3. Copyright (c) 2005-2006 Dan Marsden
  4. Copyright (c) 2010 Christopher Schmidt
  5. Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. ==============================================================================*/
  8. #ifndef BOOST_FUSION_ADAPTED_ADT_DETAIL_EXTENSION_HPP
  9. #define BOOST_FUSION_ADAPTED_ADT_DETAIL_EXTENSION_HPP
  10. #include <boost/type_traits/remove_const.hpp>
  11. #include <boost/type_traits/remove_reference.hpp>
  12. #include <boost/fusion/support/as_const.hpp>
  13. #include <boost/fusion/adapted/struct/detail/extension.hpp>
  14. namespace boost { namespace fusion
  15. {
  16. namespace detail
  17. {
  18. template <typename T, typename Dummy>
  19. struct get_identity
  20. : remove_const<typename remove_reference<T>::type>
  21. {};
  22. }
  23. namespace extension
  24. {
  25. // Overload as_const() to unwrap adt_attribute_proxy.
  26. template <typename T, int N, bool Const>
  27. typename adt_attribute_proxy<T, N, Const>::type as_const(const adt_attribute_proxy<T, N, Const>& proxy)
  28. {
  29. return proxy.get();
  30. }
  31. }
  32. }}
  33. #endif