Opened 14 years ago

Closed 14 years ago

#2060 closed Bugs (wontfix)

auto_ptr support for unit_test_log.set_formatter

Reported by: Daryle Walker Owned by: Gennadiy Rozental
Milestone: Boost 1.36.0 Component: test
Version: Boost 1.35.0 Severity: Problem
Keywords: test formatter unit_test_log Cc:

Description

The member function void boost::unit_test::unit_test_log_t::set_formatter( boost::unit_test::unit_test_log_formatter* ) gives the log ownership of the given formatter. Isn't it customary to use std::auto_ptr<boost::unit_test::unit_test_log_formatter> for this purpose? The intentions would be clearer. And it would minimize the chance of submitting an object created in an incompatible manner.

This should be implemented in a new member function, so the current one can stay (but depreciated) for backwards compatibility.

Change History (1)

comment:1 by Gennadiy Rozental, 14 years ago

Resolution: wontfix
Status: newclosed

This function is similar to the scoped_ptr::reset. It might be just a bit safer to pass auto_ptr. But I don't believe it warrants interface change. Also I am a bit unsure I want to mix different memory management tools. I also prefer to stay away from auto_ptr as a general rule. Maybe we can pass scoped_ptr and move it into data member once this functionality available.

All in all this is advanced API. One should assume person using it will have a reason to understand what to pass.

Note: See TracTickets for help on using tickets.