Я пишу небольшую программу с boost :: asio для конвертации ipv6 в ipv4, она хорошо компилируется, но если я запускаю свою программу, я получаю:
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::bad_cast> >'
what(): std::bad_cast
Abgebrochen (Speicherabzug geschrieben)
мой код:
#include <iostream>
#include <boost/asio/ip/address.hpp>
using namespace std;
using namespace boost::asio::ip;
int main(){
address myIP = address::from_string("fe80::c87f:db87:787b:a7c4");
address_v6 myIP6 = myIP.to_v6();
address_v4 myIP4 = myIP.to_v4();
cout << myIP4.to_string() <<endl;
return EXIT_SUCCESS;
}