21 Internet protocol [internet]

21.11 Class template ip::network_v4 [internet.network.v4]

21.11.1 ip::network_v4 constructors [internet.network.v4.cons]

constexpr network_v4() noexcept;

Postconditions: this->address().is_unspecified() == true and prefix_length() == 0.

constexpr network_v4(const address_v4& addr, int prefix_len);

Postconditions: this->address() == addr and prefix_length() == prefix_len.

Remarks: out_of_range if prefix_len < 0 or prefix_len > 32.

constexpr network_v4(const address_v4& addr, const address_v4& mask);

Postconditions: this->address() == addr and prefix_length() is equal to the number of contiguous non-zero bits in mask.

Remarks: invalid_argument if mask contains non-contiguous non-zero bits, or if the most significant bit is zero and any other bits are non-zero.