<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:59:45 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CXX-617] bsoncxx::builder::core::append of unsigned int?</title>
                <link>https://jira.mongodb.org/browse/CXX-617</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;There are overloading versions of &lt;tt&gt;bsoncxx::builder::core::append&lt;/tt&gt; that accepts native &lt;tt&gt;int32_t&lt;/tt&gt; and &lt;tt&gt;int64_t&lt;/tt&gt;.&lt;br/&gt;
But, calling it with a native uint is an error (&quot;call to member function &apos;append&apos; is ambiguous&quot;).&lt;/p&gt;

&lt;p&gt;Example:&lt;br/&gt;
&lt;tt&gt;auto document = bsoncxx::builder::basic::document{};&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;document.append(kvp(&quot;foo&quot;, 42)); // ok&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;document.append(kvp(&quot;foo&quot;, 42u)); // error&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Although we could use BSON value classes instead of native types, it needs more code if the type of value is a template argument.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;template &amp;lt;class T&amp;gt;&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;void f(T value) {&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;document.append(kvp(&quot;foo&quot;, value));&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;}&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;f(42u); // error&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Are there workarounds?&lt;br/&gt;
If not, should we edit the C++ driver and add these overloading functions?&lt;/p&gt;</description>
                <environment>Linux Mint 17.2 RC amd64&lt;br/&gt;
clang++ -std=c++11 -stdlib=libstdc++</environment>
        <key id="213574">CXX-617</key>
            <summary>bsoncxx::builder::core::append of unsigned int?</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="hczhcz">hczhcz</reporter>
                        <labels>
                    </labels>
                <created>Sun, 28 Jun 2015 15:44:43 +0000</created>
                <updated>Wed, 11 Sep 2019 19:05:02 +0000</updated>
                            <resolved>Sun, 28 Jun 2015 19:03:51 +0000</resolved>
                                    <version>0.2.0</version>
                                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="952801" author="hczhcz" created="Mon, 29 Jun 2015 05:30:39 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=adam.midvidy&quot; class=&quot;user-hover&quot; rel=&quot;adam.midvidy&quot;&gt;adam.midvidy&lt;/a&gt;, thanks!&lt;/p&gt;</comment>
                            <comment id="952675" author="adam.midvidy" created="Sun, 28 Jun 2015 19:03:51 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=hczhcz&quot; class=&quot;user-hover&quot; rel=&quot;hczhcz&quot;&gt;hczhcz&lt;/a&gt;, this is actually by design. If you look at the BSON specification (&lt;a href=&quot;http://bsonspec.org/spec.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://bsonspec.org/spec.html&lt;/a&gt;) the two integer types supported are a 32-bit signed integer and a 64-bit signed integer. &lt;/p&gt;

&lt;p&gt;It would be unsafe for us to provide an overload for unsigned integers as there would be the potential for overflow. I recommend instead that you static_cast your integral values to signed types before appending them to a document, if you can be sure that the values fit in the corresponding signed type.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsaqlj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>