mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Tidy up includes:
* Replace boost with std equivalents: - bind, ref, cref, function, placeholders * More "include what you use" * Remove unnecessary includes
This commit is contained in:
@@ -18,17 +18,15 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <beast/asio/IPAddressConversion.h>
|
||||
#include <beast/asio/placeholders.h>
|
||||
#include <beast/intrusive/List.h>
|
||||
#include <beast/threads/SharedData.h>
|
||||
|
||||
#include <boost/asio/ip/tcp.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include <cassert>
|
||||
#include <climits>
|
||||
#include <deque>
|
||||
#include <functional>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <thread>
|
||||
@@ -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)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <beast/asio/wrap_handler.h>
|
||||
#include <beast/asio/placeholders.h>
|
||||
#include <beast/unit_test/suite.h>
|
||||
|
||||
#include <boost/asio/ssl/stream.hpp>
|
||||
#include <beast/cxx14/memory.h> // <memory>
|
||||
|
||||
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 ();
|
||||
|
||||
@@ -38,22 +38,6 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Unfortunately, we use some boost detail elements
|
||||
//
|
||||
// https://svn.boost.org/trac/boost/ticket/9024
|
||||
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/asio/ssl.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/asio/detail/handler_alloc_helpers.hpp>
|
||||
#include <boost/asio/detail/handler_invoke_helpers.hpp>
|
||||
#include <boost/asio/detail/handler_cont_helpers.hpp>
|
||||
|
||||
// work-around for broken <boost/get_pointer.hpp>
|
||||
#include <beast/boost/get_pointer.h>
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef BEAST_ASIO_TESTS_TESTPEERBASICS_H_INCLUDED
|
||||
#define BEAST_ASIO_TESTS_TESTPEERBASICS_H_INCLUDED
|
||||
|
||||
#include <boost/asio/ssl/stream_base.hpp>
|
||||
|
||||
namespace beast {
|
||||
namespace asio {
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <beast/asio/placeholders.h>
|
||||
|
||||
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
|
||||
{
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
#include <beast/asio/placeholders.h>
|
||||
|
||||
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
|
||||
{
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef BEAST_ASIO_TESTS_TESTPEERTYPE_H_INCLUDED
|
||||
#define BEAST_ASIO_TESTS_TESTPEERTYPE_H_INCLUDED
|
||||
|
||||
#include <beast/asio/placeholders.h>
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
@@ -28,10 +28,6 @@
|
||||
#include <beast/Config.h>
|
||||
#include <beast/config/ContractChecks.h>
|
||||
|
||||
#include <beast/module/core/system/BeforeBoost.h>
|
||||
#include <beast/module/core/system/BoostIncludes.h>
|
||||
#include <beast/module/core/system/FunctionalIncludes.h>
|
||||
|
||||
#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 <beast/module/core/system/Functional.h>
|
||||
|
||||
#include <beast/module/core/time/AtExitHook.h>
|
||||
#include <beast/module/core/time/Time.h>
|
||||
#include <beast/module/core/threads/ScopedLock.h>
|
||||
|
||||
@@ -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 <beast/module/core/system/BoostPlaceholdersFix.cpp>
|
||||
|
||||
@@ -20,8 +20,11 @@
|
||||
#ifndef BEAST_SEMANTICVERSION_H_INCLUDED
|
||||
#define BEAST_SEMANTICVERSION_H_INCLUDED
|
||||
|
||||
namespace beast
|
||||
{
|
||||
#include <beast/strings/String.h>
|
||||
#include <beast/module/core/text/StringArray.h>
|
||||
#include <beast/utility/noexcept.h>
|
||||
|
||||
namespace beast {
|
||||
|
||||
/** A Semantic Version number.
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#ifndef BEAST_LOGGER_H_INCLUDED
|
||||
#define BEAST_LOGGER_H_INCLUDED
|
||||
|
||||
#include <beast/strings/String.h>
|
||||
|
||||
namespace beast
|
||||
{
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
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 <beast/Config.h>
|
||||
|
||||
// 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 <beast/module/core/system/BoostPlaceholdersFix.h>
|
||||
|
||||
#endif
|
||||
@@ -1,32 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
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 <boost/config.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/thread/tss.hpp> // for FifoFreeStoreWithTLS
|
||||
#include <boost/version.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,42 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
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
|
||||
@@ -1,64 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
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 <boost/bind/placeholders.hpp> 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 <boost/bind.hpp>
|
||||
#include <boost/bind/arg.hpp>
|
||||
|
||||
// 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
|
||||
@@ -1,381 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
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
|
||||
@@ -1,54 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
||||
|
||||
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 <ciso646> // 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 <functional>
|
||||
#elif BEAST_FUNCTIONAL_USES_TR1
|
||||
#include <tr1/functional>
|
||||
#elif BEAST_FUNCTIONAL_USES_BOOST
|
||||
// included in BoostPlaceholdersFix.h
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -24,6 +24,7 @@
|
||||
#ifndef BEAST_STRINGARRAY_H_INCLUDED
|
||||
#define BEAST_STRINGARRAY_H_INCLUDED
|
||||
|
||||
#include <beast/strings/String.h>
|
||||
#include <beast/module/core/containers/Array.h>
|
||||
#include <beast/module/core/threads/CriticalSection.h>
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#define BEAST_CRITICALSECTION_H_INCLUDED
|
||||
|
||||
#include <beast/module/core/threads/ScopedLock.h>
|
||||
#include <cstdint>
|
||||
|
||||
namespace beast {
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
#include <beast/Config.h>
|
||||
#include <beast/Uncopyable.h>
|
||||
#include <beast/StaticAssert.h>
|
||||
|
||||
#include <beast/smart_ptr/ContainerDeletePolicy.h>
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace beast {
|
||||
|
||||
//==============================================================================
|
||||
|
||||
@@ -22,13 +22,9 @@
|
||||
|
||||
#include <beast/unit_test/amount.h>
|
||||
#include <beast/unit_test/recorder.h>
|
||||
|
||||
#include <beast/streams/abstract_ostream.h>
|
||||
#include <beast/streams/basic_std_ostream.h>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user