2
0
mirror of https://github.com/boostorg/asio.git synced 2026-02-25 14:32:08 +00:00

Ensure arguments to handlers are passed as const types.

[SVN r63570]
This commit is contained in:
Christopher Kohlhoff
2010-07-04 06:57:32 +00:00
parent 1654c3271c
commit 7ead504f73
5 changed files with 29 additions and 19 deletions

View File

@@ -37,7 +37,7 @@ public:
void operator()()
{
handler_(arg1_);
handler_(static_cast<const Arg1&>(arg1_));
}
void operator()() const
@@ -94,7 +94,8 @@ public:
void operator()()
{
handler_(arg1_, arg2_);
handler_(static_cast<const Arg1&>(arg1_),
static_cast<const Arg2&>(arg2_));
}
void operator()() const
@@ -154,7 +155,9 @@ public:
void operator()()
{
handler_(arg1_, arg2_, arg3_);
handler_(static_cast<const Arg1&>(arg1_),
static_cast<const Arg2&>(arg2_),
static_cast<const Arg3&>(arg3_));
}
void operator()() const
@@ -218,7 +221,10 @@ public:
void operator()()
{
handler_(arg1_, arg2_, arg3_, arg4_);
handler_(static_cast<const Arg1&>(arg1_),
static_cast<const Arg2&>(arg2_),
static_cast<const Arg3&>(arg3_),
static_cast<const Arg4&>(arg4_));
}
void operator()() const
@@ -289,7 +295,11 @@ public:
void operator()()
{
handler_(arg1_, arg2_, arg3_, arg4_, arg5_);
handler_(static_cast<const Arg1&>(arg1_),
static_cast<const Arg2&>(arg2_),
static_cast<const Arg3&>(arg3_),
static_cast<const Arg4&>(arg4_),
static_cast<const Arg5&>(arg5_));
}
void operator()() const

View File

@@ -160,7 +160,7 @@ namespace detail
break;
}
handler_(ec, total_transferred_);
handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -212,7 +212,7 @@ namespace detail
break;
}
handler_(ec, total_transferred_);
handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -317,7 +317,7 @@ namespace detail
break;
}
handler_(ec, total_transferred_);
handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}

View File

@@ -173,7 +173,7 @@ namespace detail
break;
}
handler_(ec, total_transferred_);
handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -226,7 +226,7 @@ namespace detail
break;
}
handler_(ec, total_transferred_);
handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -338,7 +338,7 @@ namespace detail
break;
}
handler_(ec, total_transferred_);
handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}

View File

@@ -146,7 +146,7 @@ namespace detail
break;
}
handler_(ec, total_transferred_);
handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -198,7 +198,7 @@ namespace detail
break;
}
handler_(ec, total_transferred_);
handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -249,7 +249,7 @@ namespace detail
break;
}
handler_(ec, total_transferred_);
handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -328,7 +328,7 @@ namespace detail
}
void operator()(const boost::system::error_code& ec,
std::size_t bytes_transferred)
const std::size_t bytes_transferred)
{
streambuf_.consume(bytes_transferred);
handler_(ec, bytes_transferred);

View File

@@ -157,7 +157,7 @@ namespace detail
break;
}
handler_(ec, total_transferred_);
handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -211,7 +211,7 @@ namespace detail
break;
}
handler_(ec, total_transferred_);
handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -264,7 +264,7 @@ namespace detail
break;
}
handler_(ec, total_transferred_);
handler_(ec, static_cast<const std::size_t>(total_transferred_));
}
}
@@ -347,7 +347,7 @@ namespace detail
}
void operator()(const boost::system::error_code& ec,
std::size_t bytes_transferred)
const std::size_t bytes_transferred)
{
streambuf_.consume(bytes_transferred);
handler_(ec, bytes_transferred);