as_const.hpp 976 B

1234567891011121314151617181920212223242526
  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. namespace boost { namespace fusion { namespace extension
  9. {
  10. // A customization point that allows certain wrappers around
  11. // Fusion sequence elements (e.g. adt_attribute_proxy) to be
  12. // unwrapped in contexts where the element only needs to be
  13. // read. The library wraps accesses to Fusion elements in
  14. // such contexts with calls to this function. Users can
  15. // specialize this function for their own wrappers.
  16. template <typename T>
  17. const T& as_const(const T& obj)
  18. {
  19. return obj;
  20. }
  21. }}}
  22. #endif