Mercurial > octave
changeset 32775:0983439079bc stable
oct-stream.h: Use C++11 compatible code.
* libinterp/corefcn/oct-stream.h (base_stream::preferred_output_stream): Avoid
using std::make_unique which requires C++14.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Thu, 18 Jan 2024 19:28:38 +0100 |
parents | 7c33fb8098d8 |
children | 8de10f0e1ded e96e2f9f9f37 |
files | libinterp/corefcn/oct-stream.h |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.h Thu Jan 18 18:02:42 2024 +0100 +++ b/libinterp/corefcn/oct-stream.h Thu Jan 18 19:28:38 2024 +0100 @@ -129,10 +129,14 @@ 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 ());