diff --git a/beast/insight/impl/StatsDCollector.cpp b/beast/insight/impl/StatsDCollector.cpp index 8d1b1d7828..9d6d586445 100644 --- a/beast/insight/impl/StatsDCollector.cpp +++ b/beast/insight/impl/StatsDCollector.cpp @@ -18,17 +18,15 @@ //============================================================================== #include +#include #include #include - #include -#include -#include #include - #include #include #include +#include #include #include #include @@ -238,7 +236,7 @@ public: : m_journal (journal) , m_address (address) , m_prefix (prefix) - , m_work (boost::ref (m_io_service)) + , m_work (std::ref (m_io_service)) , m_timer (m_io_service) , m_socket (m_io_service) , m_thread (&StatsDCollectorImp::run, this) @@ -372,10 +370,10 @@ public: #if BEAST_STATSDCOLLECTOR_TRACING_ENABLED log (buffers); #endif - m_socket.async_send (buffers, boost::bind ( + m_socket.async_send (buffers, std::bind ( &StatsDCollectorImp::on_send, this, - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); + beast::asio::placeholders::error, + beast::asio::placeholders::bytes_transferred)); buffers.clear (); size = 0; } @@ -387,10 +385,10 @@ public: #if BEAST_STATSDCOLLECTOR_TRACING_ENABLED log (buffers); #endif - m_socket.async_send (buffers, boost::bind ( + m_socket.async_send (buffers, std::bind ( &StatsDCollectorImp::on_send, this, - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); + beast::asio::placeholders::error, + beast::asio::placeholders::bytes_transferred)); } m_data.clear (); } @@ -398,9 +396,9 @@ public: void set_timer () { m_timer.expires_from_now (boost::posix_time::seconds (1)); - m_timer.async_wait (boost::bind ( + m_timer.async_wait (std::bind ( &StatsDCollectorImp::on_timer, this, - boost::asio::placeholders::error)); + beast::asio::placeholders::error)); } void on_timer (boost::system::error_code ec) diff --git a/beast/module/asio/http/HTTPClientType.cpp b/beast/module/asio/http/HTTPClientType.cpp index 2527d372ef..a7ba129447 100644 --- a/beast/module/asio/http/HTTPClientType.cpp +++ b/beast/module/asio/http/HTTPClientType.cpp @@ -20,7 +20,7 @@ #include #include #include - +#include #include // namespace beast { @@ -71,8 +71,8 @@ public: { result_type result; boost::asio::io_service io_service; - async_get (io_service, url, beast::bind ( - &HTTPClientType::handle_get, beast::placeholders::_1, &result)); + async_get (io_service, url, std::bind ( + &HTTPClientType::handle_get, std::placeholders::_1, &result)); io_service.run (); return result; } @@ -656,8 +656,8 @@ public: HTTPClientBase::New (Journal(), timeoutSeconds)); client->async_get (t.get_io_service (), ParsedURL (s).url (), - beast::bind (&HTTPClient_test::handle_get, this, - beast::_1)); + std::bind (&HTTPClient_test::handle_get, this, + std::placeholders::_1)); t.start (); t.join (); diff --git a/beast/module/asio/system/BoostIncludes.h b/beast/module/asio/system/BoostIncludes.h index 4415e8e5f0..471a54a1f8 100644 --- a/beast/module/asio/system/BoostIncludes.h +++ b/beast/module/asio/system/BoostIncludes.h @@ -38,22 +38,6 @@ # endif #endif -// Unfortunately, we use some boost detail elements -// -// https://svn.boost.org/trac/boost/ticket/9024 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - // work-around for broken #include diff --git a/beast/module/asio/tests/TestPeerBasics.h b/beast/module/asio/tests/TestPeerBasics.h index 676cca2c81..1d7fb87eb4 100644 --- a/beast/module/asio/tests/TestPeerBasics.h +++ b/beast/module/asio/tests/TestPeerBasics.h @@ -20,6 +20,8 @@ #ifndef BEAST_ASIO_TESTS_TESTPEERBASICS_H_INCLUDED #define BEAST_ASIO_TESTS_TESTPEERBASICS_H_INCLUDED +#include + namespace beast { namespace asio { diff --git a/beast/module/asio/tests/TestPeerLogicAsyncClient.cpp b/beast/module/asio/tests/TestPeerLogicAsyncClient.cpp index af15148758..3dfc4ef928 100644 --- a/beast/module/asio/tests/TestPeerLogicAsyncClient.cpp +++ b/beast/module/asio/tests/TestPeerLogicAsyncClient.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include + namespace beast { namespace asio { @@ -43,8 +45,8 @@ void TestPeerLogicAsyncClient::on_connect_async (error_code const& ec) if (socket ().needs_handshake ()) { socket ().async_handshake (abstract_socket::client, - boost::bind (&TestPeerLogicAsyncClient::on_handshake, this, - boost::asio::placeholders::error)); + std::bind (&TestPeerLogicAsyncClient::on_handshake, this, + beast::asio::placeholders::error)); } else { @@ -58,8 +60,9 @@ void TestPeerLogicAsyncClient::on_handshake (error_code const& ec) return finished (); boost::asio::async_write (socket (), boost::asio::buffer ("hello", 5), - boost::bind (&TestPeerLogicAsyncClient::on_write, this, - boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); + std::bind (&TestPeerLogicAsyncClient::on_write, this, + beast::asio::placeholders::error, + beast::asio::placeholders::bytes_transferred)); } void TestPeerLogicAsyncClient::on_write (error_code const& ec, std::size_t bytes_transferred) @@ -71,8 +74,8 @@ void TestPeerLogicAsyncClient::on_write (error_code const& ec, std::size_t bytes return finished (); boost::asio::async_read_until (socket (), m_buf, std::string ("goodbye"), - boost::bind (&TestPeerLogicAsyncClient::on_read, this, - boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); + std::bind (&TestPeerLogicAsyncClient::on_read, this, + beast::asio::placeholders::error, beast::asio::placeholders::bytes_transferred)); } void TestPeerLogicAsyncClient::on_read (error_code const& ec, std::size_t bytes_transferred) @@ -89,8 +92,8 @@ void TestPeerLogicAsyncClient::on_read (error_code const& ec, std::size_t bytes_ // Fire up a 1 byte read, to wait for the server to // shut down its end of the connection. boost::asio::async_read (socket (), m_buf.prepare (1), - boost::bind (&TestPeerLogicAsyncClient::on_read_final, this, - boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); + std::bind (&TestPeerLogicAsyncClient::on_read_final, this, + beast::asio::placeholders::error, beast::asio::placeholders::bytes_transferred)); } void TestPeerLogicAsyncClient::on_read_final (error_code const& ec, std::size_t) @@ -104,8 +107,8 @@ void TestPeerLogicAsyncClient::on_read_final (error_code const& ec, std::size_t) { if (socket ().needs_handshake ()) { - socket ().async_shutdown (boost::bind (&TestPeerLogicAsyncClient::on_shutdown, this, - boost::asio::placeholders::error)); + socket ().async_shutdown (std::bind (&TestPeerLogicAsyncClient::on_shutdown, this, + beast::asio::placeholders::error)); } else { diff --git a/beast/module/asio/tests/TestPeerLogicAsyncServer.cpp b/beast/module/asio/tests/TestPeerLogicAsyncServer.cpp index 76b7567577..da3d51fe00 100644 --- a/beast/module/asio/tests/TestPeerLogicAsyncServer.cpp +++ b/beast/module/asio/tests/TestPeerLogicAsyncServer.cpp @@ -17,6 +17,8 @@ */ //============================================================================== +#include + namespace beast { namespace asio { @@ -43,8 +45,8 @@ void TestPeerLogicAsyncServer::on_connect_async (error_code const& ec) if (socket ().needs_handshake ()) { socket ().async_handshake (abstract_socket::server, - boost::bind (&TestPeerLogicAsyncServer::on_handshake, this, - boost::asio::placeholders::error)); + std::bind (&TestPeerLogicAsyncServer::on_handshake, this, + beast::asio::placeholders::error)); } else { @@ -58,8 +60,8 @@ void TestPeerLogicAsyncServer::on_handshake (error_code const& ec) return finished (); boost::asio::async_read_until (socket (), m_buf, std::string ("hello"), - boost::bind (&TestPeerLogicAsyncServer::on_read, this, - boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); + std::bind (&TestPeerLogicAsyncServer::on_read, this, + beast::asio::placeholders::error, beast::asio::placeholders::bytes_transferred)); } void TestPeerLogicAsyncServer::on_read (error_code const& ec, std::size_t bytes_transferred) @@ -71,8 +73,8 @@ void TestPeerLogicAsyncServer::on_read (error_code const& ec, std::size_t bytes_ return finished (); boost::asio::async_write (socket (), boost::asio::buffer ("goodbye", 7), - boost::bind (&TestPeerLogicAsyncServer::on_write, this, - boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); + std::bind (&TestPeerLogicAsyncServer::on_write, this, + beast::asio::placeholders::error, beast::asio::placeholders::bytes_transferred)); } void TestPeerLogicAsyncServer::on_write (error_code const& ec, std::size_t bytes_transferred) @@ -85,8 +87,8 @@ void TestPeerLogicAsyncServer::on_write (error_code const& ec, std::size_t bytes if (socket ().needs_handshake ()) { - socket ().async_shutdown (boost::bind (&TestPeerLogicAsyncServer::on_shutdown, this, - boost::asio::placeholders::error)); + socket ().async_shutdown (std::bind (&TestPeerLogicAsyncServer::on_shutdown, this, + beast::asio::placeholders::error)); } else { diff --git a/beast/module/asio/tests/TestPeerType.h b/beast/module/asio/tests/TestPeerType.h index 6dc0d6b761..47b1d323a0 100644 --- a/beast/module/asio/tests/TestPeerType.h +++ b/beast/module/asio/tests/TestPeerType.h @@ -20,6 +20,8 @@ #ifndef BEAST_ASIO_TESTS_TESTPEERTYPE_H_INCLUDED #define BEAST_ASIO_TESTS_TESTPEERTYPE_H_INCLUDED +#include + namespace beast { namespace asio { @@ -98,8 +100,8 @@ public: m_timer.expires_from_now ( boost::posix_time::seconds (timeoutSeconds)); - m_timer.async_wait (boost::bind (&This::on_deadline, - this, boost::asio::placeholders::error)); + m_timer.async_wait (std::bind (&This::on_deadline, + this, beast::asio::placeholders::error)); m_timer_set = true; } @@ -270,8 +272,8 @@ public: if (failure (error ())) return finished (); - get_acceptor ().async_accept (get_socket (), boost::bind ( - &This::on_accept, this, boost::asio::placeholders::error)); + get_acceptor ().async_accept (get_socket (), std::bind ( + &This::on_accept, this, beast::asio::placeholders::error)); } //-------------------------------------------------------------------------- @@ -289,7 +291,8 @@ public: void run_async_client () { get_native_socket ().async_connect (get_endpoint (get_role ()), - boost::bind (&Logic::on_connect_async, this, boost::asio::placeholders::error)); + std::bind (&Logic::on_connect_async, this, + beast::asio::placeholders::error)); } //-------------------------------------------------------------------------- diff --git a/beast/module/core/core.h b/beast/module/core/core.h index c4e9b54f44..f720550114 100644 --- a/beast/module/core/core.h +++ b/beast/module/core/core.h @@ -28,10 +28,6 @@ #include #include -#include -#include -#include - #if BEAST_MSVC # pragma warning (disable: 4251) // (DLL build warning, must be disabled before pushing the warning state) # pragma warning (push) @@ -78,8 +74,6 @@ class FileOutputStream; // Order matters, since headers don't have their own #include lines. // Add new includes to the bottom. -#include - #include #include #include diff --git a/beast/module/core/core.unity.cpp b/beast/module/core/core.unity.cpp index 23b32392aa..aa6a0756b5 100644 --- a/beast/module/core/core.unity.cpp +++ b/beast/module/core/core.unity.cpp @@ -232,6 +232,3 @@ void beast_reportFatalError (char const* message, char const* fileName, int line #pragma pop_macro("_aligned_offset_recalloc") #pragma pop_macro("_aligned_msize") #endif - -// Must be outside the namespace -#include diff --git a/beast/module/core/diagnostic/SemanticVersion.h b/beast/module/core/diagnostic/SemanticVersion.h index 2e58a3fa61..fba61f1a4c 100644 --- a/beast/module/core/diagnostic/SemanticVersion.h +++ b/beast/module/core/diagnostic/SemanticVersion.h @@ -20,8 +20,11 @@ #ifndef BEAST_SEMANTICVERSION_H_INCLUDED #define BEAST_SEMANTICVERSION_H_INCLUDED -namespace beast -{ +#include +#include +#include + +namespace beast { /** A Semantic Version number. diff --git a/beast/module/core/logging/Logger.h b/beast/module/core/logging/Logger.h index d41d458629..73aab2694a 100644 --- a/beast/module/core/logging/Logger.h +++ b/beast/module/core/logging/Logger.h @@ -24,6 +24,8 @@ #ifndef BEAST_LOGGER_H_INCLUDED #define BEAST_LOGGER_H_INCLUDED +#include + namespace beast { diff --git a/beast/module/core/system/BeforeBoost.h b/beast/module/core/system/BeforeBoost.h deleted file mode 100644 index 287d0d8505..0000000000 --- a/beast/module/core/system/BeforeBoost.h +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -/* - This file is part of Beast: https://github.com/vinniefalco/Beast - Copyright 2013, Vinnie Falco - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - -#ifndef BEAST_CORE_SYSTEM_BEFOREBOOST_H_INCLUDED -#define BEAST_CORE_SYSTEM_BEFOREBOOST_H_INCLUDED - -// TargetPlatform.h should not use anything from BeastConfig.h -#include - -// This file should be included before including any boost headers. -// If you don't include this file, and you include boost headers, -// Beast will generate a compile error with an explanation of why. - -#include - -#endif diff --git a/beast/module/core/system/BoostIncludes.h b/beast/module/core/system/BoostIncludes.h deleted file mode 100644 index dc4416feb9..0000000000 --- a/beast/module/core/system/BoostIncludes.h +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -/* - This file is part of Beast: https://github.com/vinniefalco/Beast - Copyright 2013, Vinnie Falco - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - -#ifndef BEAST_CORE_BOOSTINCLUDES_H_INCLUDED -#define BEAST_CORE_BOOSTINCLUDES_H_INCLUDED - -#if BEAST_USE_BOOST_FEATURES - -#include -#include -#include // for FifoFreeStoreWithTLS -#include - -#endif - -#endif diff --git a/beast/module/core/system/BoostPlaceholdersFix.cpp b/beast/module/core/system/BoostPlaceholdersFix.cpp deleted file mode 100644 index fc814c9ff1..0000000000 --- a/beast/module/core/system/BoostPlaceholdersFix.cpp +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -/* - This file is part of Beast: https://github.com/vinniefalco/Beast - Copyright 2013, Vinnie Falco - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - -#if BEAST_USE_BOOST_FEATURES - -namespace boost -{ - -namespace placeholders -{ - -boost::arg<1> _1; -boost::arg<2> _2; -boost::arg<3> _3; -boost::arg<4> _4; -boost::arg<5> _5; -boost::arg<6> _6; -boost::arg<7> _7; -boost::arg<8> _8; -boost::arg<9> _9; - -} - -} - -#endif diff --git a/beast/module/core/system/BoostPlaceholdersFix.h b/beast/module/core/system/BoostPlaceholdersFix.h deleted file mode 100644 index 2711c382b9..0000000000 --- a/beast/module/core/system/BoostPlaceholdersFix.h +++ /dev/null @@ -1,64 +0,0 @@ -//------------------------------------------------------------------------------ -/* - This file is part of Beast: https://github.com/vinniefalco/Beast - Copyright 2013, Vinnie Falco - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - -#ifndef BEAST_CORE_SYSTEM_BOOSTPLACEHOLDERSFIX_H_INCLUDED -#define BEAST_CORE_SYSTEM_BOOSTPLACEHOLDERSFIX_H_INCLUDED - -#if BEAST_USE_BOOST_FEATURES - -// Prevent from being included -#ifdef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED -# error "boost/bind.hpp must not be included before this file" -#else -# define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED -#endif - -#include -#include - -// This is a hack to fix boost's goofy placeholders going into the global -// namespace. First we prevent the user from including boost/bind.hpp -// before us. Then we define the include guard macro and include -// boost/bind.hpp ourselves to get the declarations. Finally we repeat -// the missing placeholder declarations but put them in a proper namespace. -// -// We put the placeholders in boost::placeholders so they can be accessed -// explicitly to handle the common case of a "using namespace oost" directive -// being in effect. -// -// Declarations based on boost/bind/placeholders.cpp -// -namespace boost { -namespace placeholders { -extern boost::arg<1> _1; -extern boost::arg<2> _2; -extern boost::arg<3> _3; -extern boost::arg<4> _4; -extern boost::arg<5> _5; -extern boost::arg<6> _6; -extern boost::arg<7> _7; -extern boost::arg<8> _8; -extern boost::arg<9> _9; -} -using namespace placeholders; -} - -#endif - -#endif diff --git a/beast/module/core/system/Functional.h b/beast/module/core/system/Functional.h deleted file mode 100644 index faac1e13a0..0000000000 --- a/beast/module/core/system/Functional.h +++ /dev/null @@ -1,381 +0,0 @@ -//------------------------------------------------------------------------------ -/* - This file is part of Beast: https://github.com/vinniefalco/Beast - Copyright 2013, Vinnie Falco - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - -#ifndef BEAST_FUNCTIONAL_H_INCLUDED -#define BEAST_FUNCTIONAL_H_INCLUDED - -namespace beast -{ - -//------------------------------------------------------------------------------ - -/* Brings functional support into our namespace, based on environment. - - Notes on bind - - Difference between boost::bind and std::bind - http://stackoverflow.com/questions/10555566/is-there-any-difference-between-c11-stdbind-and-boostbind - - Resolving conflict between boost::shared_ptr and std::shared_ptr - http://stackoverflow.com/questions/4682343/how-to-resolve-conflict-between-boostshared-ptr-and-using-stdshared-ptr -*/ - -#ifndef BEAST_BIND_PLACEHOLDERS_N -# if BEAST_MSVC && BEAST_FUNCTIONAL_USES_STD -# define BEAST_BIND_PLACEHOLDERS_N 20 // Visual Studio 2012 -# else -# define BEAST_BIND_PLACEHOLDERS_N 8 // Seems a reasonable number -# endif -#endif - -/** Max number of arguments to bind, total. -*/ -#if BEAST_MSVC -# ifdef _VARIADIC_MAX -# define BEAST_VARIADIC_MAX _VARIADIC_MAX -# else -# define BEAST_VARIADIC_MAX 10 -# endif -#else -# define BEAST_VARIADIC_MAX 10 -#endif - -//------------------------------------------------------------------------------ - -#if BEAST_FUNCTIONAL_USES_STD - -namespace functional -{ - -using std::ref; -using std::cref; -using std::bind; - -//using std::function; - -} - -using namespace functional; - -namespace placeholders -{ - -#if BEAST_BIND_PLACEHOLDERS_N >= 1 -using std::placeholders::_1; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 2 -using std::placeholders::_2; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 3 -using std::placeholders::_3; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 4 -using std::placeholders::_4; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 5 -using std::placeholders::_5; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 6 -using std::placeholders::_6; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 7 -using std::placeholders::_7; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 8 -using std::placeholders::_8; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 9 -using std::placeholders::_9; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 10 -using std::placeholders::_10; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 11 -using std::placeholders::_11; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 12 -using std::placeholders::_12; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 13 -using std::placeholders::_13; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 14 -using std::placeholders::_14; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 15 -using std::placeholders::_15; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 16 -using std::placeholders::_16; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 17 -using std::placeholders::_17; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 18 -using std::placeholders::_18; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 19 -using std::placeholders::_19; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 20 -using std::placeholders::_20; -#endif - -} - -using namespace placeholders; - -//------------------------------------------------------------------------------ - -#elif BEAST_FUNCTIONAL_USES_TR1 - -namespace functional -{ - -using std::tr1::ref; -using std::tr1::cref; -using std::tr1::bind; - -//using std::tr1::function; - -} - -using namespace functional; - -namespace placeholders -{ - -#if BEAST_BIND_PLACEHOLDERS_N >= 1 -using std::tr1::placeholders::_1; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 2 -using std::tr1::placeholders::_2; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 3 -using std::tr1::placeholders::_3; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 4 -using std::tr1::placeholders::_4; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 5 -using std::tr1::placeholders::_5; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 6 -using std::tr1::placeholders::_6; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 7 -using std::tr1::placeholders::_7; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 8 -using std::tr1::placeholders::_8; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 9 -using std::tr1::placeholders::_9; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 10 -using std::tr1::placeholders::_10; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 11 -using std::tr1::placeholders::_11; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 12 -using std::tr1::placeholders::_12; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 13 -using std::tr1::placeholders::_13; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 14 -using std::tr1::placeholders::_14; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 15 -using std::tr1::placeholders::_15; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 16 -using std::tr1::placeholders::_16; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 17 -using std::tr1::placeholders::_17; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 18 -using std::tr1::placeholders::_18; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 19 -using std::tr1::placeholders::_19; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 20 -using std::tr1::placeholders::_20; -#endif - -} - -using namespace placeholders; - -//------------------------------------------------------------------------------ - -#elif BEAST_FUNCTIONAL_USES_BOOST - -namespace functional -{ - -using boost::ref; -using boost::cref; -using boost::bind; - -//using boost::function; - -} - -using namespace functional; - -namespace placeholders -{ - -#if BEAST_BIND_PLACEHOLDERS_N >= 1 -using boost::placeholders::_1; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 2 -using boost::placeholders::_2; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 3 -using boost::placeholders::_3; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 4 -using boost::placeholders::_4; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 5 -using boost::placeholders::_5; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 6 -using boost::placeholders::_6; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 7 -using boost::placeholders::_7; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 8 -using boost::placeholders::_8; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 9 -using boost::placeholders::_9; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 10 -using boost::placeholders::_10; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 11 -using boost::placeholders::_11; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 12 -using boost::placeholders::_12; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 13 -using boost::placeholders::_13; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 14 -using boost::placeholders::_14; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 15 -using boost::placeholders::_15; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 16 -using boost::placeholders::_16; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 17 -using boost::placeholders::_17; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 18 -using boost::placeholders::_18; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 19 -using boost::placeholders::_19; -#endif - -#if BEAST_BIND_PLACEHOLDERS_N >= 20 -using boost::placeholders::_20; -#endif - -} - -using namespace placeholders; - -//------------------------------------------------------------------------------ - -#else - -#error Unknown bind source in Functional.h - -#endif - -} // beast - -#endif diff --git a/beast/module/core/system/FunctionalIncludes.h b/beast/module/core/system/FunctionalIncludes.h deleted file mode 100644 index bc042832eb..0000000000 --- a/beast/module/core/system/FunctionalIncludes.h +++ /dev/null @@ -1,54 +0,0 @@ -//------------------------------------------------------------------------------ -/* - This file is part of Beast: https://github.com/vinniefalco/Beast - Copyright 2013, Vinnie Falco - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ -//============================================================================== - -#ifndef BEAST_CORE_SYSTEM_FUNCTIONALINCLUDES_H_INCLUDED -#define BEAST_CORE_SYSTEM_FUNCTIONALINCLUDES_H_INCLUDED - -// Choose a source of bind, placeholders, and function - -#if !BEAST_FUNCTIONAL_USES_STD && !BEAST_FUNCTIONAL_USES_TR1 && !BEAST_FUNCTIONAL_USES_BOOST -# if BEAST_USE_BOOST_FEATURES -# define BEAST_FUNCTIONAL_USES_BOOST 1 -# elif BEAST_MSVC -# define BEAST_FUNCTIONAL_USES_STD 1 -# elif BEAST_IOS || BEAST_MAC -#include // detect version of std::lib -# if BEAST_IOS && BEAST_USE_BOOST_FEATURES // Work-around for iOS bugs with bind. -# define BEAST_FUNCTIONAL_USES_BOOST 1 -# elif _LIBCPP_VERSION // libc++ -# define BEAST_FUNCTIONAL_USES_STD 1 -# else // libstdc++ (GNU) -# define BEAST_FUNCTIONAL_USES_TR1 1 -# endif -# elif BEAST_LINUX || BEAST_BSD -# define BEAST_FUNCTIONAL_USES_TR1 1 -# else -# define BEAST_FUNCTIONAL_USES_STD 1 -# endif -#endif - -#if BEAST_FUNCTIONAL_USES_STD -#include -#elif BEAST_FUNCTIONAL_USES_TR1 -#include -#elif BEAST_FUNCTIONAL_USES_BOOST -// included in BoostPlaceholdersFix.h -#endif - -#endif diff --git a/beast/module/core/text/StringArray.h b/beast/module/core/text/StringArray.h index 5cbfe4f401..aa61c60cb1 100644 --- a/beast/module/core/text/StringArray.h +++ b/beast/module/core/text/StringArray.h @@ -24,6 +24,7 @@ #ifndef BEAST_STRINGARRAY_H_INCLUDED #define BEAST_STRINGARRAY_H_INCLUDED +#include #include #include diff --git a/beast/module/core/threads/CriticalSection.h b/beast/module/core/threads/CriticalSection.h index f66fec739e..5130c568f8 100644 --- a/beast/module/core/threads/CriticalSection.h +++ b/beast/module/core/threads/CriticalSection.h @@ -25,6 +25,7 @@ #define BEAST_CRITICALSECTION_H_INCLUDED #include +#include namespace beast { diff --git a/beast/smart_ptr/ScopedPointer.h b/beast/smart_ptr/ScopedPointer.h index aa3bd0eda2..52eb1c70d6 100644 --- a/beast/smart_ptr/ScopedPointer.h +++ b/beast/smart_ptr/ScopedPointer.h @@ -27,9 +27,9 @@ #include #include #include - #include - +#include + namespace beast { //============================================================================== diff --git a/beast/unit_test/reporter.h b/beast/unit_test/reporter.h index c206ac47ef..0503f11a1a 100644 --- a/beast/unit_test/reporter.h +++ b/beast/unit_test/reporter.h @@ -22,13 +22,9 @@ #include #include - #include #include - #include -#include - #include #include @@ -116,7 +112,7 @@ public: reporter& operator= (reporter const&) = delete; explicit reporter (std::ostream& stream = std::cout) - : m_std_ostream (boost::ref (stream)) + : m_std_ostream (std::ref (stream)) , m_stream (*m_std_ostream) { }