pointee_ref.rst 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 pointee
  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. ``Dereferenceable::element_type`` shall be an accessible type.
  14. Otherwise ``iterator_traits<Dereferenceable>::value_type`` shall
  15. be well formed. [Note: These requirements need not apply to
  16. explicit or partial specializations of ``pointee``]
  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. {
  21. return ``Dereferenceable::element_type``
  22. }
  23. else if (``*x`` is a mutable reference to
  24. std::iterator_traits<Dereferenceable>::value_type)
  25. {
  26. return iterator_traits<Dereferenceable>::value_type
  27. }
  28. else
  29. {
  30. return iterator_traits<Dereferenceable>::value_type const
  31. }