tags.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0.1 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  5. <title>Boost.Flyweight Documentation - Tags reference</title>
  6. <link rel="stylesheet" href="../style.css" type="text/css">
  7. <link rel="start" href="../index.html">
  8. <link rel="prev" href="key_value.html">
  9. <link rel="up" href="index.html">
  10. <link rel="next" href="factories.html">
  11. </head>
  12. <body>
  13. <h1><img src="../../../../boost.png" alt="Boost logo" align=
  14. "middle" width="277" height="86">Boost.Flyweight
  15. Tags reference</h1>
  16. <div class="prev_link"><a href="key_value.html"><img src="../prev.gif" alt="key-value flyweights" border="0"><br>
  17. Key-value flyweights
  18. </a></div>
  19. <div class="up_link"><a href="index.html"><img src="../up.gif" alt="Boost.Flyweight reference" border="0"><br>
  20. Boost.Flyweight reference
  21. </a></div>
  22. <div class="next_link"><a href="factories.html"><img src="../next.gif" alt="factories" border="0"><br>
  23. Factories
  24. </a></div><br clear="all" style="clear: all;">
  25. <hr>
  26. <h2>Contents</h2>
  27. <ul>
  28. <li><a href="#tag">Tags</a></li>
  29. <li><a href="#tag_synopsis">Header
  30. <code>"boost/flyweight/tag.hpp"</code> synopsis</a>
  31. <ul>
  32. <li><a href="#tag_construct">Class template <code>tag</code></a></li>
  33. </ul>
  34. </li>
  35. </ul>
  36. <h2><a name="tag">Tags</a></h2>
  37. <p>
  38. A <i>tag</i> is a type of the form
  39. <a href="#tag_construct"><code>tag&lt;T&gt;</code></a> for some arbitrary
  40. <code>T</code>.
  41. In the context of Boost.Flyweight, tags are syntactic artifacts used
  42. to differentiate instantiations of the class template
  43. <a href="flyweight.html#flyweight"><code>flyweight</code></a> which would
  44. otherwise be identical. Tagging a <code>flyweight</code> instantiation with
  45. a tag type local to a given context ensures that the global resources
  46. of that instantiation (for instance, the associated
  47. <a href="factories.html#factory">factory class</a>) will not be unintentionally
  48. shared by other areas of the program.
  49. </p>
  50. <h2><a name="tag_synopsis">Header
  51. <a href="../../../../boost/flyweight/tag.hpp"><code>"boost/flyweight/tag.hpp"</code></a> synopsis</a></h2>
  52. <blockquote><pre>
  53. <span class=keyword>namespace</span> <span class=identifier>boost</span><span class=special>{</span>
  54. <span class=keyword>namespace</span> <span class=identifier>flyweights</span><span class=special>{</span>
  55. <span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>T</span><span class=special>&gt;</span>
  56. <span class=keyword>struct</span> <span class=identifier>tag</span><span class=special>;</span>
  57. <span class=special>}</span> <span class=comment>// namespace boost::flyweights</span>
  58. <span class=special>}</span> <span class=comment>// namespace boost</span>
  59. </pre></blockquote>
  60. <h3><a name="tag_construct">Class template <code>tag</code></a></h3>
  61. <p>
  62. For any type <code>T</code>, <code>tag&lt;T&gt;</code> is a suitable
  63. <a href="#tag">tag</a> for use in instantiations of
  64. <a href="flyweight.html#flyweight"><code>flyweight</code></a>.
  65. </p>
  66. <hr>
  67. <div class="prev_link"><a href="key_value.html"><img src="../prev.gif" alt="key-value flyweights" border="0"><br>
  68. Key-value flyweights
  69. </a></div>
  70. <div class="up_link"><a href="index.html"><img src="../up.gif" alt="Boost.Flyweight reference" border="0"><br>
  71. Boost.Flyweight reference
  72. </a></div>
  73. <div class="next_link"><a href="factories.html"><img src="../next.gif" alt="factories" border="0"><br>
  74. Factories
  75. </a></div><br clear="all" style="clear: all;">
  76. <br>
  77. <p>Revised August 11th 2008</p>
  78. <p>&copy; Copyright 2006-2008 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
  79. Distributed under the Boost Software
  80. License, Version 1.0. (See accompanying file <a href="../../../../LICENSE_1_0.txt">
  81. LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
  82. http://www.boost.org/LICENSE_1_0.txt</a>)
  83. </p>
  84. </body>
  85. </html>