[/
 / Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 /
 / Distributed under the Boost Software License, Version 1.0. (See accompanying
 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 /]

[section:ConvertibleToConstBuffer Convertible to const buffer requirements]

A type that meets the requirements for convertibility to a const buffer must
meet the requirements of `CopyConstructible` types (C++ Std, 20.1.3), and the
requirements of `Assignable` types (C++ Std, 23.1).

In the table below, `X` denotes a class meeting the requirements for
convertibility to a const buffer, `a` and `b` denote values of type `X`, and
`u`, `v` and `w` denote identifiers.

[table ConvertibleToConstBuffer requirements
  [[expression][postcondition]]
  [
    [``
      const_buffer u(a);
      const_buffer v(a);
    ``]
    [``
      buffer_cast<const void*>(u) == buffer_cast<const void*>(v)
        && buffer_size(u) == buffer_size(v)
    ``]
  ]
  [
    [``
      const_buffer u(a);
      const_buffer v = a;
    ``]
    [``
      buffer_cast<const void*>(u) == buffer_cast<const void*>(v)
        && buffer_size(u) == buffer_size(v)
    ``]
  ]
  [
    [``
      const_buffer u(a);
      const_buffer v; v = a;
    ``]
    [``
      buffer_cast<const void*>(u) == buffer_cast<const void*>(v)
        && buffer_size(u) == buffer_size(v)
    ``]
  ]
  [
    [``
      const_buffer u(a);
      const X& v = a;
      const_buffer w(v);
    ``]
    [``
      buffer_cast<const void*>(u) == buffer_cast<const void*>(w)
        && buffer_size(u) == buffer_size(w)
    ``]
  ]
  [
    [``
      const_buffer u(a);
      X v(a);
      const_buffer w(v);
    ``]
    [``
      buffer_cast<const void*>(u) == buffer_cast<const void*>(w)
        && buffer_size(u) == buffer_size(w)
    ``]
  ]
  [
    [``
      const_buffer u(a);
      X v = a;
      const_buffer w(v);
    ``]
    [``
      buffer_cast<const void*>(u) == buffer_cast<const void*>(w)
        && buffer_size(u) == buffer_size(w)
    ``]
  ]
  [
    [``
      const_buffer u(a);
      X v(b); v = a;
      const_buffer w(v);
    ``]
    [``
      buffer_cast<const void*>(u) == buffer_cast<const void*>(w)
        && buffer_size(u) == buffer_size(w)
    ``]
  ]
]

[endsect]
