How to copy boost::urls::url in C++ (Boost.Url)

You can copy a boost::urls::url by using it copy constructor:

boost::urls::url url1 = boost::urls::url::parse("https://example.com/path1");
boost::urls::url url2(url1); // Copy url1 to url2 using the copy constructor