indirect_reference_ref.rst 1.0 KB

1234567891011121314151617181920212223242526272829
  1. .. Copyright David Abrahams 2004. Use, modification and distribution is
  2. .. subject to the Boost Software License, Version 1.0. (See accompanying
  3. .. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. ::
  5. template <class Dereferenceable>
  6. struct indirect_reference
  7. {
  8. typedef /* see below */ type;
  9. };
  10. :Requires: For an object ``x`` of type ``Dereferenceable``, ``*x``
  11. is well-formed. If ``++x`` is ill-formed it shall neither be
  12. ambiguous nor shall it violate access control, and
  13. ``pointee<Dereferenceable>::type&`` shall be well-formed.
  14. Otherwise ``iterator_traits<Dereferenceable>::reference`` shall
  15. be well formed. [Note: These requirements need not apply to
  16. explicit or partial specializations of ``indirect_reference``]
  17. ``type`` is determined according to the following algorithm, where
  18. ``x`` is an object of type ``Dereferenceable``::
  19. if ( ++x is ill-formed )
  20. return ``pointee<Dereferenceable>::type&``
  21. else
  22. std::iterator_traits<Dereferenceable>::reference