as_const.hpp 1.1 KB

123456789101112131415161718192021222324252627282930
  1. /*=============================================================================
  2. Copyright (c) 2012 Nathan Ridge
  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. ==============================================================================*/
  6. #ifndef BOOST_FUSION_SUPPORT_AS_CONST_HPP
  7. #define BOOST_FUSION_SUPPORT_AS_CONST_HPP
  8. #include <boost/config.hpp>
  9. #include <boost/fusion/support/config.hpp>
  10. namespace boost { namespace fusion { namespace extension
  11. {
  12. // A customization point that allows certain wrappers around
  13. // Fusion sequence elements (e.g. adt_attribute_proxy) to be
  14. // unwrapped in contexts where the element only needs to be
  15. // read. The library wraps accesses to Fusion elements in
  16. // such contexts with calls to this function. Users can
  17. // specialize this function for their own wrappers.
  18. template <typename T>
  19. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  20. inline const T& as_const(const T& obj) BOOST_NOEXCEPT
  21. {
  22. return obj;
  23. }
  24. }}}
  25. #endif