PolymorphicFunctionObject.xml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?xml version="1.0" ?>
  2. <!--
  3. Copyright 2008 Eric Niebler
  4. Distributed under the Boost
  5. Software License, Version 1.0. (See accompanying
  6. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. -->
  8. <concept name="PolymorphicFunctionObject" category="utility">
  9. <param name="Fn" role="polymorphic-function-object-type" />
  10. <models-sentence>
  11. The type <arg num="1" /> must be a model of <self/>.
  12. </models-sentence>
  13. <description>
  14. <para>
  15. A type that can be called and that follows the TR1 ResultOf
  16. protocol for return type calculation.
  17. </para>
  18. </description>
  19. <notation variables="fn">
  20. <sample-value>
  21. <type name="Fn" />
  22. </sample-value>
  23. </notation>
  24. <notation variables="a0,...an">
  25. <sample-value>
  26. <type name="A0,...An" />
  27. </sample-value>
  28. </notation>
  29. <associated-type name="result_type">
  30. <get-member-type name="type">
  31. <apply-template name="result_of">
  32. <apply-function name="Fn">
  33. <type name="A0,...An" />
  34. </apply-function>
  35. </apply-template>
  36. </get-member-type>
  37. <description>
  38. <simpara>The result of calling the Polymorphic Function Object.</simpara>
  39. </description>
  40. </associated-type>
  41. <valid-expression name="Function Call">
  42. <apply-function name="fn">
  43. <sample-value>
  44. <type name="A0,...An" />
  45. </sample-value>
  46. </apply-function>
  47. <return-type>
  48. <require-same-type testable="yes">
  49. <type name="result_type"/>
  50. </require-same-type>
  51. </return-type>
  52. <semantics>Calls the function object.</semantics>
  53. </valid-expression>
  54. <example-model>
  55. <type name="std::plus&lt;int&gt;" />
  56. </example-model>
  57. </concept>