extension.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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/fusion/support/config.hpp>
  11. #include <boost/type_traits/remove_const.hpp>
  12. #include <boost/type_traits/remove_reference.hpp>
  13. #include <boost/fusion/support/as_const.hpp>
  14. #include <boost/fusion/adapted/struct/detail/extension.hpp>
  15. namespace boost { namespace fusion
  16. {
  17. namespace detail
  18. {
  19. template <typename T, typename Dummy>
  20. struct get_identity
  21. : remove_const<typename remove_reference<T>::type>
  22. {};
  23. }
  24. namespace extension
  25. {
  26. // Overload as_const() to unwrap adt_attribute_proxy.
  27. template <typename T, int N, bool Const>
  28. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  29. typename adt_attribute_proxy<T, N, Const>::type as_const(const adt_attribute_proxy<T, N, Const>& proxy)
  30. {
  31. return proxy.get();
  32. }
  33. }
  34. }}
  35. #endif