$search
00001 // 00002 // handler_invoke_helpers.hpp 00003 // ~~~~~~~~~~~~~~~~~~~~~~~~~~ 00004 // 00005 // Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) 00006 // 00007 // Distributed under the Boost Software License, Version 1.0. (See accompanying 00008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 00009 // 00010 00011 #ifndef ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP 00012 #define ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP 00013 00014 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 00015 # pragma once 00016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 00017 00018 #include "asio/detail/push_options.hpp" 00019 00020 #include "asio/detail/push_options.hpp" 00021 #include <boost/detail/workaround.hpp> 00022 #include "asio/detail/pop_options.hpp" 00023 00024 #include "asio/handler_invoke_hook.hpp" 00025 00026 // Calls to asio_handler_invoke must be made from a namespace that does not 00027 // contain overloads of this function. The asio_handler_invoke_helpers 00028 // namespace is defined here for that purpose. 00029 namespace asio_handler_invoke_helpers { 00030 00031 template <typename Function, typename Context> 00032 inline void invoke(const Function& function, Context* context) 00033 { 00034 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) 00035 Function tmp(function); 00036 tmp(); 00037 #else 00038 using namespace asio; 00039 asio_handler_invoke(function, context); 00040 #endif 00041 } 00042 00043 } // namespace asio_handler_invoke_helpers 00044 00045 #include "asio/detail/pop_options.hpp" 00046 00047 #endif // ASIO_DETAIL_HANDLER_INVOKE_HELPERS_HPP