Skip to content

Commit

Permalink
oct-stream.h: Use C++11 compatible code.
Browse files Browse the repository at this point in the history
* libinterp/corefcn/oct-stream.h (base_stream::preferred_output_stream): Avoid
using std::make_unique which requires C++14.
  • Loading branch information
mmuetzel committed Jan 18, 2024
1 parent b152715 commit f98ef8d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libinterp/corefcn/oct-stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,14 @@ base_stream
std::ostream *os = output_stream ();
if (os && *os)
{
// FIXME: Using std::make_unique could simplify the following
// expressions once we require C++14.
m_converter
= std::make_unique<std::wbuffer_convert<convfacet_u8, char>>
(os->rdbuf (), new convfacet_u8 (m_encoding));
m_conv_ostream = std::make_unique<std::ostream> (m_converter.get ());
= std::unique_ptr<std::wbuffer_convert<convfacet_u8, char>>
(new std::wbuffer_convert<convfacet_u8, char>
(os->rdbuf (), new convfacet_u8 (m_encoding)));
m_conv_ostream = std::unique_ptr<std::ostream>
(new std::ostream (m_converter.get ()));
}

return (m_conv_ostream ? m_conv_ostream.get () : output_stream ());
Expand Down

0 comments on commit f98ef8d

Please sign in to comment.