[Boost-bugs] [Boost C++ Libraries] #11003: Pointless use of using namespace std

Subject: [Boost-bugs] [Boost C++ Libraries] #11003: Pointless use of using namespace std
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-02-09 15:59:40


#11003: Pointless use of using namespace std
------------------------------+----------------------------
 Reporter: fsmv@… | Owner: chris_kohlhoff
     Type: Patches | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.57.0 | Severity: Cosmetic
 Keywords: |
------------------------------+----------------------------
 There's a few lines in boost/asio/detail/impl/signal_set_service.ipp that
 use "using namespace std" inside a block for a single call to std::memset
 rather than just using "std::memset." These blocks of code are also
 clearly copied from each other but that might not be an issue.

 Here's a patch switching those lines around:
 {{{
 --- boost/asio/detail/impl/signal_set_service.ipp Mon Feb 9 10:42:58
 2015
 +++ boost/asio/detail/impl/signal_set_service.ipp Mon Feb 9 10:44:35
 2015
 @@ -271,9 +271,8 @@
      if (state->registration_count_[signal_number] == 0)
      {
  # if defined(BOOST_ASIO_HAS_SIGACTION)
 - using namespace std; // For memset.
        struct sigaction sa;
 - memset(&sa, 0, sizeof(sa));
 + std::memset(&sa, 0, sizeof(sa));
        sa.sa_handler = boost_asio_signal_handler;
        sigfillset(&sa.sa_mask);
        if (::sigaction(signal_number, &sa, 0) == -1)
 @@ -342,9 +341,8 @@
      if (state->registration_count_[signal_number] == 1)
      {
  # if defined(BOOST_ASIO_HAS_SIGACTION)
 - using namespace std; // For memset.
        struct sigaction sa;
 - memset(&sa, 0, sizeof(sa));
 + std::memset(&sa, 0, sizeof(sa));
        sa.sa_handler = SIG_DFL;
        if (::sigaction(signal_number, &sa, 0) == -1)
  # else // defined(BOOST_ASIO_HAS_SIGACTION)
 @@ -396,9 +394,8 @@
      if (state->registration_count_[reg->signal_number_] == 1)
      {
  # if defined(BOOST_ASIO_HAS_SIGACTION)
 - using namespace std; // For memset.
        struct sigaction sa;
 - memset(&sa, 0, sizeof(sa));
 + std::memset(&sa, 0, sizeof(sa));
        sa.sa_handler = SIG_DFL;
        if (::sigaction(reg->signal_number_, &sa, 0) == -1)
  # else // defined(BOOST_ASIO_HAS_SIGACTION)
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11003>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC