⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lists.html

📁 PTypes (C++ Portable Types Library) is a simple alternative to the STL that includes multithreading
💻 HTML
字号:
<html><!-- #BeginTemplate "/Templates/tmpl.dwt" --><head><!-- #BeginEditable "doctitle" --> <title>PTypes: lists</title><!-- #EndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link rel="stylesheet" href="styles.css"></head><body bgcolor="#FFFFFF" leftmargin="40" marginwidth="40"><p><a href="../index.html"><img src="title-1.7.gif" width="213" height="34" alt="C++ Portable Types Library (PTypes) Version 1.7" border="0"></a> <hr noshade><!-- #BeginEditable "body" --> <p class="hpath"><a href="index.html">Top</a>: <a href="basic.html">Basic types</a>: Lists</p><ul><li> <h5><a href="lists.objlist.html">objlist</a> - dynamic list of <i>unknown</i> objects</h5></li><li> <h5><a href="lists.strlist.html">strlist</a> - dynamic list of string/object pairs</h5></li><li> <h5><a href="lists.strmap.html">strmap</a> - associative array of <i>unknown</i> objects</h5></li></ul><p>PTypes provides three different types of dynamic arrays: list of objects (<span class="lang">objlist</span>), list of string/object pairs, optionally sorted (<span class="lang">strlist</span>), and associative array of objects mapped through strings (<span class="lang">strmap</span>). Unlike STL, PTypes uses no templates: lists always work with objects of type <span class="lang">unknown</span> or any derivative class. A list (naturally) can contain objects of different types simultaneously.</p><p>PTypes lists can optionally free member objects whenever an item is deleted or the entire list is destroyed. This mechanism called &quot;owning objects&quot; can be turned on or off during construction of a list object.</p><p>Lists themselves are derived from <span class="lang">unknown</span>, thus allowing to construct more complex dynamic structures, such like multidimensional arrays or trees.</p><p>Like with <span class="lang">string</span> and <span class="lang">cset</span> classes, most of the list manipulator functions are defined outside of the classes definitions, i.e. as friend functions. For example, you write <span class="lang">add(list, item)</span> instead of <span class="lang">list.add(item)</span>. This style imitates built-in language types and produces lesser member function calls in your program. In our opinion this style helps to improve readability of your code.</p><p>All three list classes have their equivalents declared as templates with a prefix 't' in their names, e.g. <span class="lang">tstrlist</span>. These templates are provided for better type checking at compile time. They are fully inlined and do not produce any extra code. An argument to the template can be of any type derived from <span class="lang">unknown</span>. For example, if you declare a variable of type <span class="lang">tstrlist&lt;myclass&gt;</span>, all pointers accepted or returned by the manipulation functions will be checked for compatibility with <span class="lang">myclass</span> at compile-time.</p><p>The list class family is declared in <span class="lang">&lt;ptypes.h&gt;</span>.</p><p class="seealso">See also: <a href="unknown.html">unknown</a></p><!-- #EndEditable --> <hr size="1"><a href="../index.html" class="ns">PTypes home</a></body><!-- #EndTemplate --></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -