[#CSubNet-2constructor-02ef]
= xref:CSubNet.adoc[CSubNet]::CSubNet
:relfileprefix: ../
:mrdocs:

Constructors

== Synopses

Declared in `&lt;netaddress&period;h&gt;`

Construct an invalid subnet (empty, `Match()` always returns false)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CSubNet/2constructor-02e9.adoc[CSubNet]();
----

[.small]#xref:CSubNet/2constructor-02e9.adoc[_» more&period;&period;&period;_]#

Construct a single&hyphen;host subnet&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:CSubNet/2constructor-0f.adoc[CSubNet](xref:CNetAddr.adoc[CNetAddr] const& addr);
----

[.small]#xref:CSubNet/2constructor-0f.adoc[_» more&period;&period;&period;_]#

Construct from a given network start and number of bits (CIDR mask)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CSubNet/2constructor-07.adoc[CSubNet](
    xref:CNetAddr.adoc[CNetAddr] const& addr,
    uint8&lowbar;t mask);
----

[.small]#xref:CSubNet/2constructor-07.adoc[_» more&period;&period;&period;_]#

Construct from a given network start and mask&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CSubNet/2constructor-01.adoc[CSubNet](
    xref:CNetAddr.adoc[CNetAddr] const& addr,
    xref:CNetAddr.adoc[CNetAddr] const& mask);
----

[.small]#xref:CSubNet/2constructor-01.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *addr* [in]
| The sole address to be contained in the subnet, can also be non&hyphen;IPv&lsqb;46&rsqb;&period;
| *mask* [in]
| CIDR mask, must be in &lsqb;0, 32&rsqb;for IPv4 addresses and in &lsqb;0, 128&rsqb;for IPv6 addresses&period; Otherwise an invalid subnet is created&period;
|===


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