Skip to content

Commit

Permalink
Explicitly specify attribute value type for make_attr_ordering in exa…
Browse files Browse the repository at this point in the history
…mples.

C++20 removed argument type typedefs in standard function objects, which made
it impossible to deduce the attribute value type from the standard function
objects. This caused compilation errors with VS2022 in C++20 mode.
  • Loading branch information
Lastique committed Oct 25, 2021
1 parent 832979e commit e957369
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example/bounded_async_log/main.cpp
Expand Up @@ -88,7 +88,7 @@ int main(int argc, char* argv[])
shared_ptr< sink_t > sink(new sink_t(
boost::make_shared< backend_t >(),
// We'll apply record ordering to ensure that records from different threads go sequentially in the file
keywords::order = logging::make_attr_ordering("RecordID", std::less< unsigned int >())));
keywords::order = logging::make_attr_ordering< unsigned int >("RecordID", std::less< unsigned int >())));

sink->locked_backend()->add_stream(strm);

Expand Down
4 changes: 2 additions & 2 deletions example/doc/sinks_async_ordering.cpp
Expand Up @@ -60,8 +60,8 @@ boost::shared_ptr< sink_t > init_logging()
// Wrap it into the frontend and register in the core
boost::shared_ptr< sink_t > sink(new sink_t(
backend, /*< pointer to the pre-initialized backend >*/
keywords::order =
logging::make_attr_ordering("LineID", std::less< unsigned int >()), /*< log record ordering predicate >*/
keywords::order = logging::make_attr_ordering< unsigned int >( /*< log record ordering predicate >*/
"LineID", std::less< unsigned int >()),
keywords::ordering_window = boost::posix_time::seconds(1) /*< latency of log record processing >*/
));
core->add_sink(sink);
Expand Down

0 comments on commit e957369

Please sign in to comment.