|
Boost-Commit : |
From: daniel_james_at_[hidden]
Date: 2008-05-25 12:14:18
Author: danieljames
Date: 2008-05-25 12:14:17 EDT (Sun, 25 May 2008)
New Revision: 45741
URL: http://svn.boost.org/trac/boost/changeset/45741
Log:
Support for variadic parameters.
Merged revisions 44832-44957,44959-44995,44997-45128,45132-45135 via svnmerge from
https://svn.boost.org/svn/boost/branches/doc
........
r44832 | danieljames | 2008-04-28 07:55:01 +0100 (Mon, 28 Apr 2008) | 2 lines
Add variadic attribute to template type parameters.
........
r44943 | danieljames | 2008-04-30 20:27:32 +0100 (Wed, 30 Apr 2008) | 1 line
Back out my half-done support for variadic template parameters.
........
r44994 | danieljames | 2008-05-01 21:52:59 +0100 (Thu, 01 May 2008) | 1 line
Support for variadic template parameters.
........
r45132 | danieljames | 2008-05-05 12:37:35 +0100 (Mon, 05 May 2008) | 2 lines
Rename variadic attributes pack.
........
r45133 | danieljames | 2008-05-05 12:37:50 +0100 (Mon, 05 May 2008) | 2 lines
Support for function parameter packs.
........
r45134 | danieljames | 2008-05-05 12:38:08 +0100 (Mon, 05 May 2008) | 2 lines
Support for inherited pack expansions.
........
r45135 | danieljames | 2008-05-05 12:38:25 +0100 (Mon, 05 May 2008) | 2 lines
Support for pack expansions in template specializations.
........
Properties modified:
trunk/ (props changed)
Text files modified:
trunk/tools/boostbook/doc/reference.dtdxml | 35 +++++++++++++++++++++++++++++++++--
trunk/tools/boostbook/doc/reference.xml | 5 +++++
trunk/tools/boostbook/dtd/boostbook.dtd | 10 ++++++++--
trunk/tools/boostbook/xsl/function.xsl | 7 ++++++-
trunk/tools/boostbook/xsl/lookup.xsl | 32 ++++++++++++++------------------
trunk/tools/boostbook/xsl/template.xsl | 5 +++++
trunk/tools/boostbook/xsl/type.xsl | 3 +++
7 files changed, 74 insertions(+), 23 deletions(-)
Modified: trunk/tools/boostbook/doc/reference.dtdxml
==============================================================================
--- trunk/tools/boostbook/doc/reference.dtdxml (original)
+++ trunk/tools/boostbook/doc/reference.dtdxml 2008-05-25 12:14:17 EDT (Sun, 25 May 2008)
@@ -17,6 +17,7 @@
<attpurpose name="filename">The name of the file associated with this element</attpurpose>
<attpurpose name="specifiers">The specifiers for this function, e.g., <code>inline</code>, <code>static</code>, etc.</attpurpose>
<attpurpose name="cv">cv-qualifiers for this method, e.g., <code>const volatile</code></attpurpose>
+<attpurpose name="pack">Set to '1' if the parameter is a parameter pack.</attpurpose>
<entity name="boost.class.content"
type="param"
@@ -533,11 +534,16 @@
<attlist name="template-type-parameter">
<attdecl>
name CDATA #REQUIRED
+ pack CDATA #IMPLIED
%boost.common.attrib;</attdecl>
<attribute name="last-revision"
type="#IMPLIED"
value="CDATA"
default=""/>
+<attribute name="pack"
+ type="#IMPLIED"
+ value="CDATA"
+ default=""/>
<attribute name="name"
type="#REQUIRED"
value="CDATA"
@@ -825,6 +831,7 @@
<attlist name="inherit">
<attdecl>
access CDATA #REQUIRED
+ pack CDATA #IMPLIED
%boost.common.attrib;</attdecl>
<attribute name="last-revision"
type="#IMPLIED"
@@ -840,6 +847,12 @@
type="#IMPLIED"
value="CDATA"
default=""/>
+<attribute name="pack"
+ type="#IMPLIED"
+ value="CDATA"
+ default="">
+ <purpose>Set to '1' if this is a pack exapansion.</purpose>
+</attribute>
<attribute name="xml:base"
type="#IMPLIED"
value="CDATA"
@@ -1656,7 +1669,9 @@
</element>
<attlist name="template-arg">
-<attdecl> %boost.common.attrib;</attdecl>
+<attdecl>
+ pack CDATA #IMPLIED
+ %boost.common.attrib;</attdecl>
<attribute name="last-revision"
type="#IMPLIED"
value="CDATA"
@@ -1665,6 +1680,12 @@
type="#IMPLIED"
value="CDATA"
default=""/>
+<attribute name="pack"
+ type="#IMPLIED"
+ value="CDATA"
+ default="">
+ <purpose>Set to '1' if this is a pack exapansion.</purpose>
+</attribute>
<attribute name="xml:base"
type="#IMPLIED"
value="CDATA"
@@ -2159,11 +2180,16 @@
<attlist name="parameter">
<attdecl>
- name CDATA #IMPLIED</attdecl>
+ name CDATA #IMPLIED
+ pack CDATA #IMPLIED</attdecl>
<attribute name="name"
type="#IMPLIED"
value="CDATA"
default=""/>
+<attribute name="pack"
+ type="#IMPLIED"
+ value="CDATA"
+ default=""/>
</attlist>
<element name="signature"
@@ -2709,11 +2735,16 @@
<attlist name="template-nontype-parameter">
<attdecl>
name CDATA #REQUIRED
+ pack CDATA #IMPLIED
%boost.common.attrib;</attdecl>
<attribute name="last-revision"
type="#IMPLIED"
value="CDATA"
default=""/>
+<attribute name="pack"
+ type="#IMPLIED"
+ value="CDATA"
+ default=""/>
<attribute name="name"
type="#REQUIRED"
value="CDATA"
Modified: trunk/tools/boostbook/doc/reference.xml
==============================================================================
--- trunk/tools/boostbook/doc/reference.xml (original)
+++ trunk/tools/boostbook/doc/reference.xml 2008-05-25 12:14:17 EDT (Sun, 25 May 2008)
@@ -288,6 +288,7 @@
<tbody>
<row><entry>last-revision</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to $Date$ to keep "last revised" information in sync with CVS changes</entry></row>
+<row><entry>pack</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to '1' if the parameter is a parameter pack.</entry></row>
<row><entry>name</entry><entry>#REQUIRED</entry><entry>CDATA</entry><entry>The name of the element being declared to referenced</entry></row>
<row><entry>id</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>A global identifier for this element</entry></row>
<row><entry>xml:base</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Implementation detail used by XIncludes</entry></row>
@@ -550,6 +551,7 @@
<row><entry>last-revision</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to $Date$ to keep "last revised" information in sync with CVS changes</entry></row>
<row><entry>access</entry><entry>#REQUIRED</entry><entry>CDATA</entry><entry>The access specifier ("public", "private", or "protected") of the inheritance.</entry></row>
<row><entry>id</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>A global identifier for this element</entry></row>
+<row><entry>pack</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to '1' if this is a pack exapansion.</entry></row>
<row><entry>xml:base</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Implementation detail used by XIncludes</entry></row>
</tbody>
</tgroup>
@@ -1300,6 +1302,7 @@
<row><entry>last-revision</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to $Date$ to keep "last revised" information in sync with CVS changes</entry></row>
<row><entry>id</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>A global identifier for this element</entry></row>
+<row><entry>pack</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to '1' if this is a pack exapansion.</entry></row>
<row><entry>xml:base</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Implementation detail used by XIncludes</entry></row>
</tbody>
</tgroup>
@@ -1806,6 +1809,7 @@
<tbody>
<row><entry>name</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>The name of the element being declared to referenced</entry></row>
+<row><entry>pack</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to '1' if the parameter is a parameter pack.</entry></row>
</tbody>
</tgroup>
</informaltable>
@@ -2299,6 +2303,7 @@
<tbody>
<row><entry>last-revision</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to $Date$ to keep "last revised" information in sync with CVS changes</entry></row>
+<row><entry>pack</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to '1' if the parameter is a parameter pack.</entry></row>
<row><entry>name</entry><entry>#REQUIRED</entry><entry>CDATA</entry><entry>The name of the element being declared to referenced</entry></row>
<row><entry>id</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>A global identifier for this element</entry></row>
<row><entry>xml:base</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Implementation detail used by XIncludes</entry></row>
Modified: trunk/tools/boostbook/dtd/boostbook.dtd
==============================================================================
--- trunk/tools/boostbook/dtd/boostbook.dtd (original)
+++ trunk/tools/boostbook/dtd/boostbook.dtd 2008-05-25 12:14:17 EDT (Sun, 25 May 2008)
@@ -167,11 +167,13 @@
<!ELEMENT template-type-parameter (default?, purpose?)>
<!ATTLIST template-type-parameter
name CDATA #REQUIRED
+ pack CDATA #IMPLIED
%boost.common.attrib;>
<!ELEMENT template-nontype-parameter (type, default?, purpose?)>
<!ATTLIST template-nontype-parameter
name CDATA #REQUIRED
+ pack CDATA #IMPLIED
%boost.common.attrib;>
<!ELEMENT template-varargs EMPTY>
@@ -181,7 +183,9 @@
<!ATTLIST specialization %boost.common.attrib;>
<!ELEMENT template-arg ANY>
-<!ATTLIST template-arg %boost.common.attrib;>
+<!ATTLIST template-arg
+ pack CDATA #IMPLIED
+ %boost.common.attrib;>
<!ELEMENT default ANY>
<!ATTLIST default %boost.common.attrib;>
@@ -189,6 +193,7 @@
<!ELEMENT inherit (type, purpose?)>
<!ATTLIST inherit
access CDATA #IMPLIED
+ pack CDATA #IMPLIED
%boost.common.attrib;>
<!ELEMENT purpose ANY>
@@ -397,7 +402,8 @@
<!ELEMENT parameter (paramtype, default?, description?)>
<!ATTLIST parameter
- name CDATA #IMPLIED>
+ name CDATA #IMPLIED
+ pack CDATA #IMPLIED>
<!ELEMENT programlisting ANY>
<!ATTLIST programlisting
Modified: trunk/tools/boostbook/xsl/function.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/function.xsl (original)
+++ trunk/tools/boostbook/xsl/function.xsl 2008-05-25 12:14:17 EDT (Sun, 25 May 2008)
@@ -363,6 +363,9 @@
<xsl:if test="$parameters">
<!-- Information for this parameter -->
<xsl:variable name="parameter" select="$parameters[position()=1]"/>
+ <xsl:variable name="pack">
+ <xsl:if test="$parameter/@pack=1"><xsl:text>...</xsl:text></xsl:if>
+ </xsl:variable>
<xsl:variable name="name">
<xsl:if test="$include-names and $parameter/@name != ''">
<xsl:text> </xsl:text><xsl:value-of select="$parameter/@name"/>
@@ -393,7 +396,7 @@
</xsl:choose>
</xsl:variable>
- <xsl:variable name="text" select="concat($type, $name, $default)"/>
+ <xsl:variable name="text" select="concat($type, $pack, $name, $default)"/>
<xsl:variable name="end-column"
select="$column + string-length($prefix) + string-length($text)"/>
@@ -410,6 +413,7 @@
mode="annotation">
<xsl:with-param name="highlight" select="true()"/>
</xsl:apply-templates>
+ <xsl:value-of select="$pack"/>
<xsl:value-of select="$name"/>
<xsl:copy-of select="$default"/>
</xsl:when>
@@ -446,6 +450,7 @@
mode="annotation">
<xsl:with-param name="highlight" select="true()"/>
</xsl:apply-templates>
+ <xsl:value-of select="$pack"/>
<xsl:value-of select="$name"/>
<xsl:value-of select="$default"/>
</xsl:when>
Modified: trunk/tools/boostbook/xsl/lookup.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/lookup.xsl (original)
+++ trunk/tools/boostbook/xsl/lookup.xsl 2008-05-25 12:14:17 EDT (Sun, 25 May 2008)
@@ -194,29 +194,25 @@
<xsl:value-of select="@name"/>
</xsl:template>
- <xsl:template name="print-specialization-name">
+ <xsl:template match="template-arg" mode="print-name">
+ <xsl:if test="position() > 1">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="text()"/>
+ <xsl:if test="@pack=1">
+ <xsl:text>...</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template
+ match="struct-specialization|class-specialization|union-specialization"
+ mode="print-name">
<xsl:value-of select="@name"/>
<xsl:text><</xsl:text>
- <xsl:value-of select="specialization/template-arg[position() = 1]/text()"/>
- <xsl:for-each select="specialization/template-arg[position() > 1]">
- <xsl:text>,</xsl:text>
- <xsl:value-of select="text()"/>
- </xsl:for-each>
+ <xsl:apply-templates select="specialization/template-arg" mode="print-name"/>
<xsl:text>></xsl:text>
</xsl:template>
- <xsl:template match="struct-specialization" mode="print-name">
- <xsl:call-template name="print-specialization-name"/>
- </xsl:template>
-
- <xsl:template match="class-specialization" mode="print-name">
- <xsl:call-template name="print-specialization-name"/>
- </xsl:template>
-
- <xsl:template match="union-specialization" mode="print-name">
- <xsl:call-template name="print-specialization-name"/>
- </xsl:template>
-
<xsl:template name="name-matches-node">
<!-- The name we are looking for -->
<xsl:param name="name"/>
Modified: trunk/tools/boostbook/xsl/template.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/template.xsl (original)
+++ trunk/tools/boostbook/xsl/template.xsl 2008-05-25 12:14:17 EDT (Sun, 25 May 2008)
@@ -314,6 +314,7 @@
<xsl:text>typename</xsl:text>
</xsl:otherwise>
</xsl:choose>
+ <xsl:if test="$parameter/@pack=1"><xsl:text>...</xsl:text></xsl:if>
<xsl:text> </xsl:text>
<xsl:call-template name="template.parameter.name">
@@ -388,6 +389,7 @@
<xsl:value-of select="$parameter/type/*|$parameter/type/text()"/>
</xsl:otherwise>
</xsl:choose>
+ <xsl:if test="$parameter/@pack=1"><xsl:text>...</xsl:text></xsl:if>
<xsl:text> </xsl:text>
<xsl:call-template name="template.parameter.name">
@@ -438,6 +440,9 @@
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:apply-templates mode="highlight"/>
+ <xsl:if test="@pack=1">
+ <xsl:text>...</xsl:text>
+ </xsl:if>
</xsl:template>
</xsl:stylesheet>
Modified: trunk/tools/boostbook/xsl/type.xsl
==============================================================================
--- trunk/tools/boostbook/xsl/type.xsl (original)
+++ trunk/tools/boostbook/xsl/type.xsl 2008-05-25 12:14:17 EDT (Sun, 25 May 2008)
@@ -533,6 +533,8 @@
</xsl:otherwise>
</xsl:choose>
+ <xsl:if test="@pack=1"><xsl:text>...</xsl:text></xsl:if>
+
<!-- Output a comma if not at the end -->
<xsl:if test="position() < $n">
<xsl:text>,</xsl:text>
@@ -626,6 +628,7 @@
<xsl:apply-templates mode="annotation">
<xsl:with-param name="highlight" select="true()"/>
</xsl:apply-templates>
+ <xsl:if test="@pack=1"><xsl:text>...</xsl:text></xsl:if>
</xsl:template>
<!-- Find the maximum length of the types in typedefs -->
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk