<div dir="ltr">hey,<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 24, 2017 at 1:04 AM, Chris Sherlock <span dir="ltr"><<a href="mailto:chris.sherlock79@gmail.com" target="_blank">chris.sherlock79@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div>Hi all,</div><div id="gmail-m_-7445065684239591991AppleMailSignature"><br></div><div id="gmail-m_-7445065684239591991AppleMailSignature">I'm getting some build failures on Jenkins. It seems there is a compilation failure because there are a number of files that use std::unique_ptr but done include <memory>.</div><div id="gmail-m_-7445065684239591991AppleMailSignature"><br></div><div id="gmail-m_-7445065684239591991AppleMailSignature">I think it may have come from here:</div><div id="gmail-m_-7445065684239591991AppleMailSignature"><br></div><div id="gmail-m_-7445065684239591991AppleMailSignature"><a href="https://gerrit.libreoffice.org/#/c/36190/" target="_blank">https://gerrit.libreoffice.<wbr>org/#/c/36190/</a></div><div id="gmail-m_-7445065684239591991AppleMailSignature"><br></div><div id="gmail-m_-7445065684239591991AppleMailSignature">The only thing is: Jenkins did a full build without any errors, so I'm scratching my head what has happened here...</div><div id="gmail-m_-7445065684239591991AppleMailSignature"><br></div><div id="gmail-m_-7445065684239591991AppleMailSignature">I guess I'm interested: do we need to include <memory> when using unique_ptr, and if so how did Jenkins manage to fully compile this code on all platforms?</div><div id="gmail-m_-7445065684239591991AppleMailSignature"><br></div><div id="gmail-m_-7445065684239591991AppleMailSignature">Chris<br></div></div></blockquote></div><br><br></div><div class="gmail_extra">I suppose that the question is related to <a href="https://gerrit.libreoffice.org/#/c/36838/">https://gerrit.libreoffice.org/#/c/36838/</a><br><br></div><div class="gmail_extra">The patch that you referenced is correct and the code compiles because header files are recursively included. So if any of the header files in the include chain contains an "#include <memory> std::unique_ptr will be available in that translation unit.<br><br></div><div class="gmail_extra">Now coming back to your patch, you changed the include chain for a number of files by no longer including a header file that will bring in the "memory" file. Therefore you need to fix the places that start to complain now manually and add the #include <memory> into these files.<br><br></div><div class="gmail_extra">Regarding the question whether to include "memory" everytime you use std::unique_ptr is a bit of a style question. There are people who advocate to always include all necessary headers and to never rely on what the included headers already include but at least in my opinion that often leads to many include statements at the beginning of a file. IMHO the more important part is to remove include lines that are not necessary any more.<br><br></div><div class="gmail_extra">Regards,<br></div><div class="gmail_extra">Markus<br></div></div>