Skip to content

Commit

Permalink
operator+(NSNumber*)書いたよ
Browse files Browse the repository at this point in the history
refs #6
  • Loading branch information
oden committed Mar 13, 2013
1 parent c1b70b2 commit 73e25a7
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 24 deletions.
95 changes: 80 additions & 15 deletions Docs/ID_h/Classes/ID/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,19 @@ <h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Discussion</font></
<br><a name="HeaderDoc_functions"></a>
<h2 class="h2tight">Member Functions</h2>
<dl>
<dt><tt><a href="index.html#//apple_ref/cpp/instm/ID/ID//(const)" target="_top">ID</a></tt></dt>
<dt><tt><a href="index.html#//apple_ref/cpp/instm/ID/ID//(const)" target="_top">ID(const)</a></tt></dt>
<dd><p>&#12467;&#12531;&#12473;&#12488;&#12521;&#12463;&#12479;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#12467;&#12531;&#12473;&#12488;&#12521;&#12463;&#12479;&#20860;&#12467;&#12500;&#12540;&#12467;&#12531;&#12473;&#12488;&#12521;&#12463;&#12479;
</p></dd>
<dt><tt><a href="index.html#//apple_ref/cpp/instm/ID/operator_id//()" target="_top">operator id</a></tt></dt>
<dt><tt><a href="index.html#//apple_ref/cpp/instm/ID/ID//(const)_DONTLINK_1" target="_top">ID(const)</a></tt></dt>
<dd><p>&#12467;&#12500;&#12540;&#12467;&#12531;&#12473;&#12488;&#12521;&#12463;&#12479;&#12290;
</p></dd>
<dt><tt><a href="index.html#//apple_ref/cpp/instm/ID/operator_id/const/()" target="_top">operator id</a></tt></dt>
<dd><p>object&#12501;&#12451;&#12540;&#12523;&#12489;&#12290;
</p></dd>
<dt><tt><a href="index.html#//apple_ref/cpp/instm/ID/operator+/ID/(const)" target="_top">operator+</a></tt></dt>
<dt><tt><a href="index.html#//apple_ref/cpp/instm/ID/operator+/ID/(constNSNumber*const)" target="_top">operator+(const NSNumber * const)</a></tt></dt>
<dd><p>&#21152;&#31639;&#28436;&#31639;&#23376;&#12458;&#12540;&#12496;&#12540;&#12525;&#12540;&#12489;&#12290;
</p></dd>
<dt><tt><a href="index.html#//apple_ref/cpp/instm/ID/operator+/ID/(const)" target="_top">operator+(const)</a></tt></dt>
<dd><p>&#21152;&#31639;&#28436;&#31639;&#23376;&#12458;&#12540;&#12496;&#12540;&#12525;&#12540;&#12489;&#12290;
</p></dd>
<dt><tt><a href="index.html#//apple_ref/cpp/instm/ID/operator+%3D/ID%26/(const)" target="_top">operator+=</a></tt></dt>
Expand All @@ -246,14 +252,14 @@ <h2 class="h2tight">Member Functions</h2>
</dl>
<hr class="betweenAPIEntries">
<!-- headerDoc=instm; uid=//apple_ref/cpp/instm/ID/ID//(const); name=ID::ID --><a name="//apple_ref/cpp/instm/ID/ID//(const)"></a>
<h3><a name="ID">ID</a></h3>
<h3><a name="ID(const)">ID(const)</a></h3>
<hr class="afterName">
<p><!-- headerDoc=abstract;uid=//apple_ref/cpp/instm/ID/ID//(const);name=start --><!-- begin abstract --></p>
<p>&#12467;&#12531;&#12473;&#12488;&#12521;&#12463;&#12479;&#12290;&#12487;&#12501;&#12457;&#12523;&#12488;&#12467;&#12531;&#12473;&#12488;&#12521;&#12463;&#12479;&#20860;&#12467;&#12500;&#12540;&#12467;&#12531;&#12473;&#12488;&#12521;&#12463;&#12479;
<!-- end abstract --><!-- headerDoc=abstract;uid=//apple_ref/cpp/instm/ID/ID//(const);name=end --></p>
<div class="declaration_indent">
<pre><tt>public</tt>
<br><a machinegenerated="true" href="index.html#//apple_ref/cpp/instm/ID/ID//(const)" logicalPath="//apple_ref/cpp/instm/ID/ID" target="_top"><span class="function">ID</span></a>(
<br><a machinegenerated="true" href="index.html#//apple_ref/cpp/instm/ID/ID//(const)_DONTLINK_1" logicalPath="//apple_ref/cpp/instm/ID/ID" target="_top"><span class="function">ID</span></a>(
<span class="keyword">const</span> <a machinegenerated="true" href="index.html#//apple_ref/doc/functionparam/ID/operator+%3D/id" logicalPath="//apple_ref/cpp/cl/id //apple_ref/cpp/tdef/id //apple_ref/cpp/tag/id //apple_ref/cpp/struct/id //apple_ref/cpp/intf/id //apple_ref/doc/anysymbol/id" target="_top"><span class="type">id</span></a> = <span class="param">nil</span>); </pre>
</div>
<h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Parameters</font></h5>
Expand All @@ -272,36 +278,95 @@ <h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Discussion</font></
<!-- headerDoc=discussion;uid=//apple_ref/cpp/instm/ID/ID//(const);name=end --><!-- end discussion -->
</p>
<hr class="betweenAPIEntries">
<!-- headerDoc=instm; uid=//apple_ref/cpp/instm/ID/operator_id//(); name=ID::operator id --><a name="//apple_ref/cpp/instm/ID/operator_id//()"></a>
<!-- headerDoc=instm; uid=//apple_ref/cpp/instm/ID/ID//(const)_DONTLINK_1; name=ID::ID --><a name="//apple_ref/cpp/instm/ID/ID//(const)_DONTLINK_1"></a>
<h3><a name="ID(const)">ID(const)</a></h3>
<hr class="afterName">
<p><!-- headerDoc=abstract;uid=//apple_ref/cpp/instm/ID/ID//(const)_DONTLINK_1;name=start --><!-- begin abstract --></p>
<p>&#12467;&#12500;&#12540;&#12467;&#12531;&#12473;&#12488;&#12521;&#12463;&#12479;&#12290;
<!-- end abstract --><!-- headerDoc=abstract;uid=//apple_ref/cpp/instm/ID/ID//(const)_DONTLINK_1;name=end --></p>
<div class="declaration_indent">
<pre><tt>public</tt>
<br><a machinegenerated="true" href="index.html#//apple_ref/cpp/instm/ID/ID//(const)_DONTLINK_1" logicalPath="//apple_ref/cpp/instm/ID/ID" target="_top"><span class="function">ID</span></a>(
<span class="keyword">const</span> <span class="param">int</span>); </pre>
</div>
<h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Parameters</font></h5>
<div class="param_indent">
<dl>
<dt>
<!-- headerDoc=functionparam; uid=//apple_ref/doc/functionparam/ID/ID/int; name=ID::int -->
<a name="//apple_ref/doc/functionparam/ID/ID/int"></a>
<code>int</code>
</dt>
<dd><p>NSNumber&#12395;&#22793;&#25563;&#21487;&#33021;&#12394;&#22411;&#12290;</p></dd>
</dl>
</div>
<h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Discussion</font></h5>
<!-- begin discussion --><!-- headerDoc=discussion;uid=//apple_ref/cpp/instm/ID/ID//(const)_DONTLINK_1;name=start --><p>id&#22411;&#12363;&#12425;&#12398;&#26263;&#40665;&#12398;&#22411;&#22793;&#25563;&#12434;&#23455;&#29694;&#12375;&#12390;&#12356;&#12427;&#12290;
<!-- headerDoc=discussion;uid=//apple_ref/cpp/instm/ID/ID//(const)_DONTLINK_1;name=end --><!-- end discussion -->
</p>
<hr class="betweenAPIEntries">
<!-- headerDoc=instm; uid=//apple_ref/cpp/instm/ID/operator_id/const/(); name=ID::operator id --><a name="//apple_ref/cpp/instm/ID/operator_id/const/()"></a>
<h3><a name="operatorid">operator id</a></h3>
<hr class="afterName">
<p><!-- headerDoc=abstract;uid=//apple_ref/cpp/instm/ID/operator_id//();name=start --><!-- begin abstract --></p>
<p><!-- headerDoc=abstract;uid=//apple_ref/cpp/instm/ID/operator_id/const/();name=start --><!-- begin abstract --></p>
<p>object&#12501;&#12451;&#12540;&#12523;&#12489;&#12290;
<!-- end abstract --><!-- headerDoc=abstract;uid=//apple_ref/cpp/instm/ID/operator_id//();name=end --></p>
<!-- end abstract --><!-- headerDoc=abstract;uid=//apple_ref/cpp/instm/ID/operator_id/const/();name=end --></p>
<div class="declaration_indent">
<pre><tt>public</tt>
<br><span class="keyword">operator</span> <a machinegenerated="true" href="index.html#//apple_ref/doc/functionparam/ID/operator+%3D/id" logicalPath="//apple_ref/cpp/instm/ID/id //apple_ref/cpp/clm/ID/id //apple_ref/cpp/intfcm/ID/id //apple_ref/cpp/intfm/ID/id //apple_ref/cpp/func/id //apple_ref/cpp/ftmplt/ID/id //apple_ref/cpp/defn/id //apple_ref/cpp/macro/id //apple_ref/doc/anysymbol/id" target="_top"><span class="function">id</span></a>(); </pre>
<br><span class="keyword">operator</span> <span class="keyword">const</span> <a machinegenerated="true" href="index.html#//apple_ref/doc/functionparam/ID/operator+%3D/id" logicalPath="//apple_ref/cpp/instm/ID/id //apple_ref/cpp/clm/ID/id //apple_ref/cpp/intfcm/ID/id //apple_ref/cpp/intfm/ID/id //apple_ref/cpp/func/id //apple_ref/cpp/ftmplt/ID/id //apple_ref/cpp/defn/id //apple_ref/cpp/macro/id //apple_ref/doc/anysymbol/id" target="_top"><span class="function">id</span></a>() <span class="keyword">const</span>; </pre>
</div>
<h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Return Value</font></h5>
<p><!-- begin return value --></p>
<p>id

<!-- end return value --></p>
<h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Discussion</font></h5>
<!-- begin discussion --><!-- headerDoc=discussion;uid=//apple_ref/cpp/instm/ID/operator_id//();name=start --><p>id&#22411;&#12408;&#12398;&#26263;&#40665;&#12398;&#22411;&#22793;&#25563;&#12434;&#23455;&#29694;&#12375;&#12390;&#12356;&#12427;&#12290;
<!-- headerDoc=discussion;uid=//apple_ref/cpp/instm/ID/operator_id//();name=end --><!-- end discussion -->
<!-- begin discussion --><!-- headerDoc=discussion;uid=//apple_ref/cpp/instm/ID/operator_id/const/();name=start --><p>id&#22411;&#12408;&#12398;&#26263;&#40665;&#12398;&#22411;&#22793;&#25563;&#12434;&#23455;&#29694;&#12375;&#12390;&#12356;&#12427;&#12290;
<!-- headerDoc=discussion;uid=//apple_ref/cpp/instm/ID/operator_id/const/();name=end --><!-- end discussion -->
</p>
<hr class="betweenAPIEntries">
<!-- headerDoc=instm; uid=//apple_ref/cpp/instm/ID/operator+/ID/(constNSNumber*const); name=ID::operator+ --><a name="//apple_ref/cpp/instm/ID/operator+/ID/(constNSNumber*const)"></a>
<h3><a name="operator+(constNSNumber*const)">operator+(const NSNumber * const)</a></h3>
<hr class="afterName">
<p><!-- headerDoc=abstract;uid=//apple_ref/cpp/instm/ID/operator+/ID/(constNSNumber*const);name=start --><!-- begin abstract --></p>
<p>&#21152;&#31639;&#28436;&#31639;&#23376;&#12458;&#12540;&#12496;&#12540;&#12525;&#12540;&#12489;&#12290;
<!-- end abstract --><!-- headerDoc=abstract;uid=//apple_ref/cpp/instm/ID/operator+/ID/(constNSNumber*const);name=end --></p>
<div class="declaration_indent">
<pre><tt>public</tt>
<br><a machinegenerated="true" href="index.html#//apple_ref/cpp/cl/ID" logicalPath="//apple_ref/cpp/cl/ID" target="_top"><span class="type">ID</span></a> <span class="keyword">operator</span>+(
<span class="keyword">const</span> <!-- a logicalPath="//apple_ref/cpp/cl/NSNumber //apple_ref/cpp/tdef/NSNumber //apple_ref/cpp/tag/NSNumber //apple_ref/cpp/struct/NSNumber //apple_ref/cpp/intf/NSNumber //apple_ref/doc/anysymbol/NSNumber" machineGenerated="true" --><span class="type">NSNumber</span><!-- /a --> <span class="type">*</span><span class="keyword">const</span> <span class="param">number</span>) <span class="keyword">const</span>; </pre>
</div>
<h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Parameters</font></h5>
<div class="param_indent">
<dl>
<dt>
<!-- headerDoc=functionparam; uid=//apple_ref/doc/functionparam/ID/operator+/number; name=operator+::number -->
<a name="//apple_ref/doc/functionparam/ID/operator+/number"></a>
<code>number</code>
</dt>
<dd> </dd>
</dl>
</div>
<h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Return Value</font></h5>
<p><!-- begin return value --></p>
<p>ID

<!-- end return value --></p>
<h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Discussion</font></h5>
<!-- begin discussion --><!-- headerDoc=discussion;uid=//apple_ref/cpp/instm/ID/operator+/ID/(constNSNumber*const);name=start --><p>object&#12501;&#12451;&#12540;&#12523;&#12489;&#12398;description&#25991;&#23383;&#21015;&#12392;&#24341;&#25968;&#12398;description&#25991;&#23383;&#21015;&#12434;&#32080;&#21512;&#12377;&#12427;&#12290;
<!-- headerDoc=discussion;uid=//apple_ref/cpp/instm/ID/operator+/ID/(constNSNumber*const);name=end --><!-- end discussion -->
</p>
<hr class="betweenAPIEntries">
<!-- headerDoc=instm; uid=//apple_ref/cpp/instm/ID/operator+/ID/(const); name=ID::operator+ --><a name="//apple_ref/cpp/instm/ID/operator+/ID/(const)"></a>
<h3><a name="operator+">operator+</a></h3>
<h3><a name="operator+(const)">operator+(const)</a></h3>
<hr class="afterName">
<p><!-- headerDoc=abstract;uid=//apple_ref/cpp/instm/ID/operator+/ID/(const);name=start --><!-- begin abstract --></p>
<p>&#21152;&#31639;&#28436;&#31639;&#23376;&#12458;&#12540;&#12496;&#12540;&#12525;&#12540;&#12489;&#12290;
<!-- end abstract --><!-- headerDoc=abstract;uid=//apple_ref/cpp/instm/ID/operator+/ID/(const);name=end --></p>
<div class="declaration_indent">
<pre><tt>public</tt>
<br><a machinegenerated="true" href="index.html#//apple_ref/cpp/cl/ID" logicalPath="//apple_ref/cpp/cl/ID" target="_top"><span class="type">ID</span></a> <span class="keyword">operator</span>+(
<span class="keyword">const</span> <span class="param">id</span>); </pre>
<span class="keyword">const</span> <span class="param">id</span>) <span class="keyword">const</span>; </pre>
</div>
<h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Parameters</font></h5>
<div class="param_indent">
Expand Down Expand Up @@ -364,7 +429,7 @@ <h3><a name="~ID">~ID</a></h3>
<!-- end abstract --><!-- headerDoc=abstract;uid=//apple_ref/doc/title:instm/ID/~ID//();name=end --></p>
<div class="declaration_indent">
<pre><tt>public</tt>
<br>~<a machinegenerated="true" href="index.html#//apple_ref/cpp/instm/ID/ID//(const)" logicalPath="//apple_ref/cpp/instm/ID/ID" target="_top"><span class="function">ID</span></a>(); </pre>
<br>~<a machinegenerated="true" href="index.html#//apple_ref/cpp/instm/ID/ID//(const)_DONTLINK_1" logicalPath="//apple_ref/cpp/instm/ID/ID" target="_top"><span class="function">ID</span></a>(); </pre>
</div>
<h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Discussion</font></h5>
<!-- begin discussion --><!-- headerDoc=discussion;uid=//apple_ref/doc/title:instm/ID/~ID//();name=start --><p>object&#12501;&#12451;&#12540;&#12523;&#12489;&#12399;release&#12373;&#12428;&#12427;&#12290;
Expand Down Expand Up @@ -396,7 +461,7 @@ <h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Discussion</font></
<p class="gapBeforeFooter">&nbsp;</p>
<hr class="afterFooter">
<div class="hd_copyright_and_timestamp">
<p class="hd_timestamp">Last Updated: Wednesday, March 13, 2013
<p class="hd_timestamp">Last Updated: Thursday, March 14, 2013
</p>
</div>
</td>
Expand Down
6 changes: 4 additions & 2 deletions Docs/ID_h/Classes/ID/toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@
<div toc="collapsible" class="collapsible">

<ul class="tocSubEntryList">
<!-- cdobj --><li class="tocSubEntry"><a href="index.html#//apple_ref/cpp/instm/ID/ID//(const)" target="_top">ID</a></li>
<!-- cdobj --><li class="tocSubEntry"><a href="index.html#//apple_ref/cpp/instm/ID/ID//(const)" target="_top">ID(const)</a></li>
<li class="tocSubEntry"><a href="index.html#//apple_ref/cpp/instm/ID/ID//(const)_DONTLINK_1" target="_top">ID(const)</a></li>
<li class="tocSubEntry"><a href="index.html#//apple_ref/doc/title:instm/ID/~ID//()" target="_top">~ID</a></li>
</ul>
<span class="hd_tocAccess">Public</span>
<ul class="tocSubEntryList">
<!-- public --><li class="tocSubEntry"><a href="index.html#//apple_ref/cpp/instm/ID/operator_id/const/()" target="_top">operator id</a></li>
<li class="tocSubEntry"><a href="index.html#//apple_ref/cpp/instm/ID/operator+/ID/(const)" target="_top">operator+</a></li>
<li class="tocSubEntry"><a href="index.html#//apple_ref/cpp/instm/ID/operator+/ID/(constNSNumber*const)" target="_top">operator+(const NSNumber * const)</a></li>
<li class="tocSubEntry"><a href="index.html#//apple_ref/cpp/instm/ID/operator+/ID/(const)" target="_top">operator+(const)</a></li>
<li class="tocSubEntry"><a href="index.html#//apple_ref/cpp/instm/ID/operator+%3D/ID%26/(const)" target="_top">operator+=</a></li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion Docs/ID_h/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ <h2 class="h2tight">Classes</h2>
<p class="gapBeforeFooter">&nbsp;</p>
<hr class="afterFooter">
<div class="hd_copyright_and_timestamp">
<p class="hd_timestamp">Last Updated: Monday, March 11, 2013
<p class="hd_timestamp">Last Updated: Thursday, March 14, 2013
</p>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ <h5 class="tight"><font face="Lucida Grande,Helvetica,Arial">Return Value</font>
<p class="gapBeforeFooter">&nbsp;</p>
<hr class="afterFooter">
<div class="hd_copyright_and_timestamp">
<p class="hd_timestamp">Last Updated: Monday, March 11, 2013
<p class="hd_timestamp">Last Updated: Thursday, March 14, 2013
</p>
</div>
</td>
Expand Down
2 changes: 1 addition & 1 deletion Docs/NSObject+OCppOperator_h/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ <h2 class="h2tight">Classes</h2>
<p class="gapBeforeFooter">&nbsp;</p>
<hr class="afterFooter">
<div class="hd_copyright_and_timestamp">
<p class="hd_timestamp">Last Updated: Monday, March 11, 2013
<p class="hd_timestamp">Last Updated: Thursday, March 14, 2013
</p>
</div>
</td>
Expand Down
2 changes: 1 addition & 1 deletion Docs/OCppOperator_h/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ <h2>Introduction</h2>
<p class="gapBeforeFooter">&nbsp;</p>
<hr class="afterFooter">
<div class="hd_copyright_and_timestamp">
<p class="hd_timestamp">Last Updated: Monday, March 11, 2013
<p class="hd_timestamp">Last Updated: Thursday, March 14, 2013
</p>
</div>
</td>
Expand Down
10 changes: 7 additions & 3 deletions Docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,22 @@ <h2>Functions</h2>
<a logicalpath="//apple_ref/cpp/instm/ID/ID//(const)" name="group___function_ID" retarget="yes" href="ID_h/Classes/ID/index.html#//apple_ref/cpp/instm/ID/ID//(const)">ID::ID</a><br>
</td>
<td width="33%">
<a logicalpath="//apple_ref/cpp/instm/ID/operator_id/const/()" retarget="yes" href="ID_h/Classes/ID/index.html#//apple_ref/cpp/instm/ID/operator_id/const/()">ID::operator id</a><br>
</td>
<td width="33%">
<a logicalpath="//apple_ref/cpp/instm/ID/operator+/ID/(const)" retarget="yes" href="ID_h/Classes/ID/index.html#//apple_ref/cpp/instm/ID/operator+/ID/(const)">ID::operator+</a><br>
</td>
<td width="33%"></td>
</tr>
<tr>
<td width="33%">
<a logicalpath="//apple_ref/cpp/instm/ID/operator_id/const/()" retarget="yes" href="ID_h/Classes/ID/index.html#//apple_ref/cpp/instm/ID/operator_id/const/()">ID::operator id</a><br>
<a logicalpath="//apple_ref/cpp/instm/ID/ID//(const)_DONTLINK_1" retarget="yes" href="ID_h/Classes/ID/index.html#//apple_ref/cpp/instm/ID/ID//(const)_DONTLINK_1">ID::ID</a><br>
</td>
<td width="33%">
<a logicalpath="//apple_ref/cpp/instm/ID/operator+/ID/(constNSNumber*const)" retarget="yes" href="ID_h/Classes/ID/index.html#//apple_ref/cpp/instm/ID/operator+/ID/(constNSNumber*const)">ID::operator+</a><br>
</td>
<td width="33%">
<a logicalpath="//apple_ref/cpp/instm/ID/operator+%3D/ID%26/(const)" retarget="yes" href="ID_h/Classes/ID/index.html#//apple_ref/cpp/instm/ID/operator+%3D/ID%26/(const)">ID::operator+=</a><br>
</td>
<td width="33%"></td>
</tr>
</table>
</blockquote>
Expand Down
8 changes: 8 additions & 0 deletions OCppOperator/ID.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ class ID
@return ID
*/
ID operator+(const id) const;
/*!
@method operator+
@abstract 加算演算子オーバーロード。
@discussion objectフィールドのdescription文字列と引数のdescription文字列を結合する。
@param number
@return ID
*/
ID operator+(const NSNumber* const number) const;
/*!
@method operator+=
@abstract 加算後代入演算子オーバーロード。
Expand Down
12 changes: 12 additions & 0 deletions OCppOperator/ID.mm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@
return [[this->object description] stringByAppendingFormat:@"%@", source];
}

ID ID::operator+(const NSNumber* const number) const
{
if (![*this isKindOfClass:[NSNumber class]])
{
return *this + (id)number;
}

id left = [NSDecimalNumber decimalNumberWithString:[*this description]];
id right = [NSDecimalNumber decimalNumberWithString:[number description]];
return [left decimalNumberByAdding:right];
}

ID& ID::operator+=(const id source)
{
[*this autorelease];
Expand Down

0 comments on commit 73e25a7

Please sign in to comment.