remove redundant set_piece_hashes template. take a std::function instead
This commit is contained in:
parent
96d215a32a
commit
5f758b8531
|
@ -391,7 +391,7 @@ namespace detail {
|
|||
// object. The optional function ``f`` is called in between every hash that is set. ``f``
|
||||
// must have the following signature::
|
||||
//
|
||||
// void Fun(int);
|
||||
// void Fun(piece_index_t);
|
||||
//
|
||||
// The overloads that don't take an ``error_code&`` may throw an exception in case of a
|
||||
// file error, the other overloads sets the error code to reflect the error, if any.
|
||||
|
@ -408,8 +408,8 @@ namespace detail {
|
|||
set_piece_hashes(t, p, detail::nop, ec);
|
||||
if (ec) throw system_error(ec);
|
||||
}
|
||||
template <class Fun>
|
||||
void set_piece_hashes(create_torrent& t, std::string const& p, Fun f)
|
||||
inline void set_piece_hashes(create_torrent& t, std::string const& p
|
||||
, std::function<void(piece_index_t)> const& f)
|
||||
{
|
||||
error_code ec;
|
||||
set_piece_hashes(t, p, f, ec);
|
||||
|
@ -439,9 +439,9 @@ namespace detail {
|
|||
, std::function<void(int)> f, error_code& ec);
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
template <class Fun>
|
||||
TORRENT_DEPRECATED
|
||||
void set_piece_hashes(create_torrent& t, std::wstring const& p, Fun f)
|
||||
inline void set_piece_hashes(create_torrent& t, std::wstring const& p
|
||||
, std::function<void(int)> f)
|
||||
{
|
||||
error_code ec;
|
||||
set_piece_hashes_deprecated(t, p, f, ec);
|
||||
|
|
Loading…
Reference in New Issue