function_property_map.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <HTML>
  2. <!--
  3. Copyright (c) 2012 Trustees of Indiana University
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENSE_1_0.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. -->
  8. <Head>
  9. <Title>Function Property Map Adaptor</Title>
  10. <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
  11. ALINK="#ff0000">
  12. <IMG SRC="../../../boost.png"
  13. ALT="C++ Boost" width="277" height="86">
  14. <BR Clear>
  15. <H2><A NAME="sec:function-property-map"></A>
  16. </h2>
  17. <PRE>
  18. function_property_map&lt;UnaryFunction, Key, Ref&gt;
  19. </PRE>
  20. <P>
  21. This property map is an adaptor that converts a function object into either a <a href="ReadablePropertyMap.html">Readable Property Map</a> or a <a href="LvaluePropertyMap.html">Lvalue Property Map</a>. The category of the property map is based on whether the function's return type (as given by <tt>Ref</tt>) is a non-const reference type.
  22. <P>
  23. <!-- <h3>Example</h3>
  24. <pre>
  25. </pre> -->
  26. <H3>Where Defined</H3>
  27. <P>
  28. <a href="../../../boost/property_map/function_property_map.hpp"><TT>boost/property_map/function_property_map.hpp</TT></a>
  29. <p>
  30. <H3>Model Of</H3>
  31. <a href="./ReadablePropertyMap.html">Readable Property Map</a> or <a href="./LvaluePropertyMap.html">Lvalue Property Map</a>
  32. <P>
  33. <H3>Template Parameters</H3>
  34. <P>
  35. <TABLE border>
  36. <TR>
  37. <th>Parameter</th><th>Description</th><th>Default</th>
  38. </tr>
  39. <TR>
  40. <TD><TT>UnaryFunction</TT></TD>
  41. <TD>Must be a model of <a href="http://www.sgi.com/tech/stl/UnaryFunction.html">Unary Function</a> that accepts an object of type <tt>Key</tt> as an argument and returns a result of type <tt>Ref</tt>.</TD>
  42. <TD>&nbsp;</td>
  43. </tr>
  44. <TR>
  45. <TD><TT>Key</TT></TD> <TD>The key type of the property map.
  46. </TD> <TD>&nbsp;</TD>
  47. </TR>
  48. <TR>
  49. <TD><TT>Ref</TT></TD>
  50. <TD>The result type of the function.</TD>
  51. <TD><TT>boost::result_of&lt;const UnaryFunction(const Key&amp;)&gt;::type</TT></TD>
  52. </TR>
  53. </TABLE>
  54. <P>
  55. <H3>Members</H3>
  56. <P>
  57. In addition to the methods and functions required by <a
  58. href="./ReadablePropertyMap.html">Readable Property Map</a> or <a href="LvaluePropertyMap.html">Lvalue Property Map</a>, this
  59. class has the following members:
  60. <hr>
  61. <pre>
  62. property_traits&lt;function_property_map&gt;::value_type
  63. </pre>
  64. The type <tt>Ref</tt> with any reference or cv-qualifiers removed.
  65. <hr>
  66. <pre>
  67. function_property_map(const UnaryFunction&amp; f = UnaryFunction())
  68. </pre>
  69. Constructor.
  70. <hr>
  71. <h3>Non-Member functions</h3>
  72. <hr>
  73. <pre>
  74. template &lt;class Key, class UnaryFunction&gt;
  75. function_property_map&lt;UnaryFunction, Key&gt;
  76. make_function_property_map(const UnaryFunction&amp; f);
  77. </pre>
  78. Returns a <tt>function_property_map</tt> using the given function and key type.
  79. <hr>
  80. <pre>
  81. template &lt;class Key, class Ref, class UnaryFunction&gt;
  82. function_property_map&lt;UnaryFunction, Key, Ref&gt;
  83. make_function_property_map(const UnaryFunction&amp; f);
  84. </pre>
  85. Returns a <tt>function_property_map</tt> using the given function and key and reference types.
  86. <hr>
  87. <br>
  88. <HR>
  89. <TABLE>
  90. <TR valign=top>
  91. <TD nowrap>Copyright &copy; 2012</TD><TD>Trustees of Indiana University
  92. </TD></TR></TABLE>
  93. </BODY>
  94. </HTML>