blob: 1feb00062a2af175ae544f32e98118fbc7063ffe [file] [log] [blame]
William A. Kennington III14dd4eb2023-01-12 10:51:12 -08001#include <stdplus/net/addr/subnet.hpp>
2
William A. Kennington III6417c632023-07-17 02:56:52 -07003#include <format>
William A. Kennington III14dd4eb2023-01-12 10:51:12 -08004#include <stdexcept>
5
William A. Kennington IIIa42dfb42023-06-28 17:48:32 -07006namespace stdplus
7{
8
9namespace detail
William A. Kennington III14dd4eb2023-01-12 10:51:12 -080010{
11
12void invalidSubnetPfx(std::size_t pfx)
13{
William A. Kennington III6417c632023-07-17 02:56:52 -070014 throw std::invalid_argument(std::format("Invalid subnet prefix {}", pfx));
William A. Kennington III14dd4eb2023-01-12 10:51:12 -080015}
16
17template class Subnet46<In4Addr, uint8_t>;
18template class Subnet46<In6Addr, uint8_t>;
19
William A. Kennington IIIa42dfb42023-06-28 17:48:32 -070020} // namespace detail
William A. Kennington III160e3822023-06-16 17:09:43 -070021
William A. Kennington IIIa42dfb42023-06-28 17:48:32 -070022template Subnet4 FromStr<Subnet4>::operator()(std::string_view) const;
23template Subnet6 FromStr<Subnet6>::operator()(std::string_view) const;
24template SubnetAny FromStr<SubnetAny>::operator()(std::string_view) const;
William A. Kennington IIId5957f52023-06-16 16:55:01 -070025
William A. Kennington IIIa42dfb42023-06-28 17:48:32 -070026template char* ToStr<Subnet4>::operator()(char*, Subnet4) const noexcept;
27template char* ToStr<Subnet6>::operator()(char*, Subnet6) const noexcept;
28template char* ToStr<SubnetAny>::operator()(char*, SubnetAny) const noexcept;
29
30} // namespace stdplus