remove redundant set_piece_hashes template. take a std::function instead

This commit is contained in:
arvidn 2018-05-10 01:11:32 +02:00 committed by Arvid Norberg
parent 96d215a32a
commit 5f758b8531
1 changed files with 5 additions and 5 deletions

View File

@ -391,7 +391,7 @@ namespace detail {
// object. The optional function ``f`` is called in between every hash that is set. ``f`` // object. The optional function ``f`` is called in between every hash that is set. ``f``
// must have the following signature:: // 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 // 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. // 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); set_piece_hashes(t, p, detail::nop, ec);
if (ec) throw system_error(ec); if (ec) throw system_error(ec);
} }
template <class Fun> inline void set_piece_hashes(create_torrent& t, std::string const& p
void set_piece_hashes(create_torrent& t, std::string const& p, Fun f) , std::function<void(piece_index_t)> const& f)
{ {
error_code ec; error_code ec;
set_piece_hashes(t, p, f, ec); set_piece_hashes(t, p, f, ec);
@ -439,9 +439,9 @@ namespace detail {
, std::function<void(int)> f, error_code& ec); , std::function<void(int)> f, error_code& ec);
#ifndef BOOST_NO_EXCEPTIONS #ifndef BOOST_NO_EXCEPTIONS
template <class Fun>
TORRENT_DEPRECATED 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; error_code ec;
set_piece_hashes_deprecated(t, p, f, ec); set_piece_hashes_deprecated(t, p, f, ec);