[#BloombergLP-ball-RuleSet-addRule]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/RuleSet.adoc[RuleSet]::addRule
:relfileprefix: ../../../
:mrdocs:

Create a new `Rule` object having the specified `value`&period; Return the non&hyphen;negative id of this non&hyphen;modifiable object on success, and a negative value otherwise&period; A return value of &hyphen;1 indicates that another rule having this value already exists&period; A return value of &hyphen;2 indicates that the maximum number of rules for this rule set has been reached&period;

== Synopsis

Declared in `&lt;ball&lowbar;ruleset&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
addRule(xref:BloombergLP/ball/Rule.adoc[Rule] const& value);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
