Use a "using namespace std" inside a function to avoid polluting the global

namespace by including string.h.
This commit is contained in:
chris 2003-10-14 08:22:08 +00:00
parent e1d6a093f1
commit 0845d217a1

View File

@ -19,7 +19,7 @@
#include "asio/detail/push_options.hpp"
#include <string>
#include <string.h>
#include <cstring>
#include <boost/integer.hpp>
#include "asio/detail/pop_options.hpp"
@ -211,6 +211,8 @@ public:
/// Set the host name.
void host_name(const std::string& host)
{
using namespace std; // For memcpy.
#if defined(_WIN32)
hostent* ent_result = gethostbyname(host.c_str());
good_ = (ent_result != 0);