> On Nov. 7, 2016, 4:38 p.m., Qian Zhang wrote: > > I do not quite understand the intention of this patch. The description of > > this patch says that `Previously, the headers did not contain includes for > > any of the classes used in the file.`, but actually `stout/os.hpp` has been > > already included which almost has all the needed headers, like > > `stout/nothing.hpp`, `stout/try.hpp`, etc. So I guess the intention of this > > patch is to remove the inclusion of `stout/os.hpp` and instead include each > > needed headers directly, right? But I still see `stout/os.hpp` in both > > `utils.hpp` and `utils.cpp` in this patch which makes me a bit confused.
The style for our include headers is to include all dependencies, so that changing the include headers of a dependency does not break any upstream code. i.e. foo.hpp: ``` #include <string> typedef std::string Fooo; ``` bar.hpp: ``` #include <map> #include <string> // <- Need this because we use it in this file. #include "foo.hpp" std::map<Fooo, std::string> bar; ``` The exception is any headers that are effectively aliases to other headers, like `stout/lambda.hpp` (to various `<functional>` types) or `src/messages/messages.hpp` (to the protobuf `messages.pb.h`). - Joseph ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/53556/#review155230 ----------------------------------------------------------- On Nov. 7, 2016, 2:49 p.m., Joseph Wu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/53556/ > ----------------------------------------------------------- > > (Updated Nov. 7, 2016, 2:49 p.m.) > > > Review request for mesos, Benjamin Bannier, Jie Yu, and Qian Zhang. > > > Bugs: MESOS-6360 > https://issues.apache.org/jira/browse/MESOS-6360 > > > Repository: mesos > > > Description > ------- > > This fixes the headers in the provisioner utility. Previously, the > headers did not contain includes for any of the classes used in the > file. > > > Diffs > ----- > > src/slave/containerizer/mesos/provisioner/utils.hpp > 4efce0ed67312417495af8c884ce26ef6affaccb > src/slave/containerizer/mesos/provisioner/utils.cpp > 340cf48819679cdd8d08d76dcd2328234477a15f > > Diff: https://reviews.apache.org/r/53556/diff/ > > > Testing > ------- > > make check (OSX) > make check (CentOS 7) > msbuild ... (Windows 10) > > > Thanks, > > Joseph Wu > >
