DITA-OT_CXX_Plugin/cxxapiref/doc/cxxFunction/cxxFunctionTemplateParameters.dita
author Jonathan Harrington <jonathan.harrington@nokia.com>
Wed, 11 Aug 2010 14:49:30 +0100
changeset 4 468f4c8d3d5b
permissions -rw-r--r--
Orb version 0.2.0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
     2
<!--
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
     3
Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
     4
All rights reserved.		
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
     5
		-->
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
     6
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
     7
<reference xml:lang="en-us" outputclass="element" id="cxxFunctionTemplateParameters">
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
     8
    <title>cxxFunctionTemplateParameters</title>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
     9
    <shortdesc>Collects together the template parameters for template functions.</shortdesc>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    10
    <refbody>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    11
        <section id="section_BB16EAA97F01427CAFFFB15C63DEAC8D">
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    12
            <title>Description</title><p>Collects together the template parameters for template functions.</p><p>See ISO/IEC 14882:2003(E) 14.1 Template parameters [temp.param]</p>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    13
        </section>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    14
        <example id="example_7637310D62AB4BDB88913D5B7CC94BDC">
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    15
            <title>Example</title><p>Given this code:</p>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    16
            <codeblock>/**
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    17
 @tparam T The type of the first function object.
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    18
 @tparam U The type of the second function object.
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    19
 @return 1 on success, 0 on failure.
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    20
 */
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    21
template&lt;typename T, typename U&gt;
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    22
int templateFunction(T&amp; x, U&amp; y)
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    23
{
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    24
} 
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    25
            </codeblock><p>Then function <tt>templateFunction
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    26
                </tt> would have the <tt>cxxFunctionTemplateParameters</tt>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    27
element:</p>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    28
            <codeblock>&lt;cxxFunctionTemplateParameters&gt;
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    29
  &lt;cxxFunctionTemplateParameter&gt;
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    30
    &lt;cxxFunctionTemplateParameterType&gt;typename T&lt;/cxxFunctionTemplateParameterType&gt;
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    31
    &lt;apiDefNote&gt;The type of the first function object. &lt;/apiDefNote&gt;
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    32
  &lt;/cxxFunctionTemplateParameter&gt;
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    33
  &lt;cxxFunctionTemplateParameter&gt;
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    34
    &lt;cxxFunctionTemplateParameterType&gt;typename U&lt;/cxxFunctionTemplateParameterType&gt;
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    35
    &lt;apiDefNote&gt;The type of the second function object. &lt;/apiDefNote&gt;
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    36
  &lt;/cxxFunctionTemplateParameter&gt;
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    37
&lt;/cxxFunctionTemplateParameters&gt;
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    38
            </codeblock><p>If the mandatory attributes are present they must be set thus:</p>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    39
            <codeblock>&lt;cxxFunctionStorageClassSpecifierExtern name="extern" value="extern"/&gt;</codeblock>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    40
        </example>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    41
        <section conref="../packagedef.dita#cxxFunctionTemplateParameters-reference/cxxFunctionTemplateParameters-containedBy-section"/>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    42
        <section conref="../packagedef.dita#cxxFunctionTemplateParameters-reference/cxxFunctionTemplateParameters-contains-section"/>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    43
        <section conref="../packagedef.dita#cxxFunctionTemplateParameters-reference/cxxFunctionTemplateParameters-contentModel-section"/>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    44
        <section conref="../packagedef.dita#cxxFunctionTemplateParameters-reference/cxxFunctionTemplateParameters-attList-section"/>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    45
        <section conref="../packagedef.dita#cxxFunctionTemplateParameters-reference/cxxFunctionTemplateParameters-classValue-section"/>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    46
    </refbody>
468f4c8d3d5b Orb version 0.2.0
Jonathan Harrington <jonathan.harrington@nokia.com>
parents:
diff changeset
    47
</reference>