Skip to content

Commit

Permalink
chore: remove obsolete usages of Boost.
Browse files Browse the repository at this point in the history
  • Loading branch information
KazDragon committed Feb 9, 2025
1 parent f171d37 commit 8a6006f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

# Requirements

Server++ requires a C++17 compiler and the following libraries:
* Boost (At least version 1.69.0)
Server++ requires a C++20 compiler and the following libraries:
* Boost (At least version 1.69.0) (for Boost.Asio)

# Installation - CMake

Expand Down
6 changes: 2 additions & 4 deletions example/echo/src/echo_server.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <boost/range/algorithm/for_each.hpp>
#include <boost/range/algorithm_ext/erase.hpp>
#include <serverpp/tcp_server.hpp>

#include <algorithm>
Expand Down Expand Up @@ -38,7 +36,7 @@ class echo_server
return connection == dead_socket;
};

boost::remove_erase_if(connections_, is_dead_socket);
std::erase_if(connections_, is_dead_socket);

std::cout << "Connection died, " << connections_.size()
<< " connections remaining\n";
Expand All @@ -52,7 +50,7 @@ class echo_server
connection->close();
};

boost::for_each(connections_, close_connection);
std::ranges::for_each(connections_, close_connection);
}

void shutdown_server()
Expand Down
7 changes: 2 additions & 5 deletions src/tcp_socket.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include "serverpp/tcp_socket.hpp"

#include <boost/lexical_cast.hpp>

#include <vector>
#include <string>

namespace serverpp {

Expand Down Expand Up @@ -48,8 +46,7 @@ void tcp_socket::write(bytes data)
// ==========================================================================
std::string tcp_socket::get_ip_address() const
{
return boost::lexical_cast<std::string>(
socket_.remote_endpoint().address());
return socket_.remote_endpoint().address().to_string();
}

// ==========================================================================
Expand Down

0 comments on commit 8a6006f

Please sign in to comment.