Permalink
Browse files

Simplifying tag dispatch for body modifier.

  • Loading branch information...
1 parent 2af5fb0 commit 1ba80791c8e6a7ce31b8ab675f739a9f0b2c62c1 @mikhailberis mikhailberis committed Nov 28, 2010
Showing with 11 additions and 15 deletions.
  1. +11 −15 boost/network/message/modifiers/body.hpp
@@ -6,28 +6,24 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#include <boost/network/support/is_async.hpp>
+#include <boost/network/support/pod_or_normal.hpp>
#include <boost/thread/future.hpp>
namespace boost { namespace network {
- namespace impl {
-
- template <class Message, class ValueType, class Tag>
- inline void body(Message const & message, ValueType const & body_, Tag const &, mpl::false_ const &) {
- message.body(body_);
- }
-
- template <class Message, class ValueType, class Tag>
- inline void body(Message const & message, ValueType const & body_, Tag const &, mpl::true_ const &) {
- message.body(body_);
- }
+ template <class Tag, template <class> class Message, class ValueType>
+ inline void body_impl(Message<Tag> & message, ValueType const & body, tags::pod) {
+ message.body = body;
+ }
- } // namespace impl
+ template <class Tag, template <class> class Message, class ValueType>
+ inline void body_impl(Message<Tag> & message, ValueType const & body, tags::normal) {
+ message.body(body);
+ }
template <class Tag, template <class> class Message, class ValueType>
- inline void body(Message<Tag> const & message, ValueType const & body_) {
- impl::body(message, body_, Tag(), is_async<Tag>());
+ inline void body(Message<Tag> & message, ValueType const & body_) {
+ body_impl(message, body_, typename pod_or_normal<Tag>::type());
}
} // namespace network

0 comments on commit 1ba8079

Please sign in to comment.