From 87a7deb35d829393e9d7ff108d71cc95248694ea Mon Sep 17 00:00:00 2001 From: Evan McCorkle Date: Mon, 23 Oct 2017 10:10:29 -0400 Subject: [PATCH] Added macro to conditionally exclude boost from API. --- CONTRIBUTING.md | 5 ++++- include/cantera/base/AnyMap.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2ccf359b3..c06a5ac4c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -70,7 +70,10 @@ `std::shared_ptr` when dynamic allocation is required. * Portions of Boost which are "header only" may be used. If possible, include Boost header files only within .cpp files rather than other header files to - avoid unnecessary increases in compilation time. + avoid unnecessary increases in compilation time. Boost should not be added + to the public interface unless its existence and use is optional. This keeps + the number of dependencies low for users of Cantera. In these cases, + CANTERA_API_NO_BOOST should be used to conditionally remove Boost dependencies. * While Cantera does not specifically follow these rules, the following style guides are useful references for possible style choices and the rationales behind them. * The Google C++ Style Guide: https://google.github.io/styleguide/cppguide.html diff --git a/include/cantera/base/AnyMap.h b/include/cantera/base/AnyMap.h index 59dc7eb8f..1b3672162 100644 --- a/include/cantera/base/AnyMap.h +++ b/include/cantera/base/AnyMap.h @@ -188,6 +188,8 @@ private: } +#ifndef CANTERA_API_NO_BOOST #include "cantera/base/AnyMap.inl.h" +#endif #endif