Subject: [Boost-bugs] [Boost C++ Libraries] #12998: Can't forward single-argument constructors to sinks
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-04-30 22:25:39
#12998: Can't forward single-argument constructors to sinks
------------------------------+---------------------
Reporter: steinar+boost@⦠| Owner: andysem
Type: Bugs | Status: new
Milestone: To Be Determined | Component: log
Version: Boost 1.63.0 | Severity: Problem
Keywords: |
------------------------------+---------------------
CasparCG has code like this:
```
class sink_backend : public
boost::log::sinks::basic_formatted_sink_backend<char>
{
std::function<void(std::string line)>
formatted_line_sink_;
public:
sink_backend(std::function<void(std::string line)>
formatted_line_sink)
:
formatted_line_sink_(std::move(formatted_line_sink))
{
}
void consume(const boost::log::record_view& rec, const
std::string& formatted_message)
{
try
{
formatted_line_sink_(formatted_message);
}
catch (...)
{
std::cerr << "[sink_backend] Error while
consuming formatted message: " << formatted_message << std::endl <<
std::endl;
}
}
};
[â¦]
auto sink =
boost::make_shared<sink_type>(std::move(formatted_line_sink));
```
This fails with a long spew of template errors, evidently because for
single-argument constructors, only variants with named parameters are
considered (sync_frontend.hpp, BOOST_LOG_SINK_CTOR_FORWARD_INTERNAL_1).
This is a regression from 1.59.0.
Adding a dummy int parameter and setting it to 0 makes the code compile.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12998> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-04-30 22:30:16 UTC