> So, you believe, a maintenance programmer should avoid
> make_unique, and prefer unique_ptr( new ... ) instead?
Possibly. Only few months ago I helped a totally new project
where combo of 'shared_from_this()' and 'std::make_shared()'
of the library of the compiler used was defective and did
crash. Note that it was 2014. I think it was Peter Dimov who
added working 'shared_from_this()' to boost ~2003 and
'make_shared' ~2008.
So 'make_unique' may be easily unavailable even for a totally
new project started right now but I would then likely write
one myself or loan it from boost.
What I actually meant was that maintenance programmer should
make minimal changes needed for fixing the issue under hand.
She should continue using style what the code was using. For
example if maintained code used 'boost::scoped_ptr' then she
should not introduce usage of 'std::unique_ptr' instead.
Otherwise it may break unit tests, the subtle differences may
cause more defects and result is needless waste of effort of
her and the team over the putrid onion of program.
Sometimes code that is decades old is maintained. For example
just because currency in a country did change. Someone needs
it but few can pay ~$500K for a total rewrite of 1000 file
code-base. Even if they are eager to pay such money then why
not to do just $50K worth of fixes and enjoy the $450K? So
the maintainer of it should continue using the "C with classes"
style of it and fix only what became broken.