interface.qbk 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. [/
  2. / Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
  3. / Copyright (c) 2003-2005 Peter Dimov
  4. /
  5. / Distributed under the Boost Software License, Version 1.0. (See
  6. / accompanying file LICENSE_1_0.txt or copy at
  7. / http://www.boost.org/LICENSE_1_0.txt)
  8. /]
  9. [section:interface Interface]
  10. [section:synopsys Synopsis]
  11. namespace boost
  12. {
  13. template<class T> T * ``[link get_pointer_1 `get_pointer`]``(T * p);
  14. template<class R, class T> ``/unspecified-1/`` ``[link mem_fn_1 `mem_fn`]``(R (T::*pmf) ());
  15. template<class R, class T> ``/unspecified-2/`` ``[link mem_fn_2 `mem_fn`]``(R (T::*pmf) () const);
  16. template<class R, class T> ``/unspecified-2-1/`` ``[link mem_fn_2_1 `mem_fn`]``(R T::*pm);
  17. template<class R, class T, class A1> ``/unspecified-3/`` ``[link mem_fn_3 `mem_fn`]``(R (T::*pmf) (A1));
  18. template<class R, class T, class A1> ``/unspecified-4/`` ``[link mem_fn_4 `mem_fn`]``(R (T::*pmf) (A1) const);
  19. template<class R, class T, class A1, class A2> ``/unspecified-5/`` ``[link mem_fn_5 `mem_fn`]``(R (T::*pmf) (A1, A2));
  20. template<class R, class T, class A1, class A2> ``/unspecified-6/`` ``[link mem_fn_6 `mem_fn`]``(R (T::*pmf) (A1, A2) const);
  21. // implementation defined number of additional overloads for more arguments
  22. }
  23. [endsect]
  24. [section Common requirements]
  25. All /unspecified-N/ types mentioned in the Synopsis are /CopyConstructible/
  26. and /Assignable/. Their copy constructors and assignment operators do not
  27. throw exceptions. /unspecified-N/`::result_type` is defined as the return type
  28. of the member function pointer passed as an argument to `mem_fn` (`R` in the
  29. Synopsis.) /unspecified-2-1/`::result_type` is defined as `R`.
  30. [endsect]
  31. [section `get_pointer`]
  32. [#get_pointer_1]
  33. template<class T> T * get_pointer(T * p)
  34. * /Returns:/ `p`.
  35. * /Throws:/ Nothing.
  36. [endsect]
  37. [section `mem_fn`]
  38. [#mem_fn_1]
  39. template<class R, class T> ``/unspecified-1/`` mem_fn(R (T::*pmf) ())
  40. * /Returns:/ a function object \u03DD such that the expression \u03DD`(t)` is
  41. equivalent to `(t.*pmf)()` when `t` is an l-value of type `T` or derived,
  42. `(get_pointer(t)->*pmf)()` otherwise.
  43. * /Throws:/ Nothing.
  44. [#mem_fn_2]
  45. template<class R, class T> ``/unspecified-2/`` mem_fn(R (T::*pmf) () const)
  46. * /Returns:/ a function object \u03DD such that the expression \u03DD`(t)` is
  47. equivalent to `(t.*pmf)()` when `t` is of type `T` /[/`const`/]/ or derived,
  48. `(get_pointer(t)->*pmf)()` otherwise.
  49. * /Throws:/ Nothing.
  50. [#mem_fn_2_1]
  51. template<class R, class T> ``/unspecified-2-1/`` mem_fn(R T::*pm)
  52. * /Returns:/ a function object \u03DD such that the expression \u03DD`(t)` is
  53. equivalent to `t.*pm` when `t` is of type `T` /[/`const`/]/ or derived,
  54. `get_pointer(t)->*pm` otherwise.
  55. * /Throws:/ Nothing.
  56. [#mem_fn_3]
  57. template<class R, class T, class A1> ``/unspecified-3/`` mem_fn(R (T::*pmf) (A1))
  58. * /Returns:/ a function object \u03DD such that the expression \u03DD`(t, a1)`
  59. is equivalent to `(t.*pmf)(a1)` when `t` is an l-value of type `T` or derived,
  60. `(get_pointer(t)->*pmf)(a1)` otherwise.
  61. * /Throws:/ Nothing.
  62. [#mem_fn_4]
  63. template<class R, class T, class A1> ``/unspecified-4/`` mem_fn(R (T::*pmf) (A1) const)
  64. * /Returns:/ a function object \u03DD such that the expression \u03DD`(t, a1)`
  65. is equivalent to `(t.*pmf)(a1)` when `t` is of type `T` /[/`const`/]/ or derived,
  66. `(get_pointer(t)->*pmf)(a1)` otherwise.
  67. * /Throws:/ Nothing.
  68. [#mem_fn_5]
  69. template<class R, class T, class A1, class A2> ``/unspecified-5/`` mem_fn(R (T::*pmf) (A1, A2))
  70. * /Returns:/ a function object \u03DD such that the expression \u03DD`(t, a1, a2)`
  71. is equivalent to `(t.*pmf)(a1, a2)` when `t` is an l-value of type `T` or derived,
  72. `(get_pointer(t)->*pmf)(a1, a2)` otherwise.
  73. * /Throws:/ Nothing.
  74. [#mem_fn_6]
  75. template<class R, class T, class A1, class A2> ``/unspecified-6/`` mem_fn(R (T::*pmf) (A1, A2) const)
  76. * /Returns:/ a function object \u03DD such that the expression \u03DD`(t, a1, a2)`
  77. is equivalent to `(t.*pmf)(a1, a2)` when `t` is of type `T` /[/`const`/]/ or derived,
  78. `(get_pointer(t)->*pmf)(a1, a2)` otherwise.
  79. * /Throws:/ Nothing.
  80. [endsect]
  81. [endsect]