From 0a1ecce9eca7528e1e332f1f9939a35f80d7ad80 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Mon, 17 Oct 2022 22:50:33 -0400 Subject: [PATCH] Permit user-specification of the real namespace of boost. This way `Alepha` can be used in a binary-only library project which uses boost or a codebase which mangles boost. --- Alepha.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Alepha.h b/Alepha.h index 2d17219..4f35b5d 100644 --- a/Alepha.h +++ b/Alepha.h @@ -2,7 +2,20 @@ static_assert( __cplusplus > 201700, "C++17 Required" ); #pragma once +#ifndef ALEPHA_OVERRIDE_BOOST_NAMESPACE +namespace boost {} +#else +namespace ALEPHA_OVERRIDE_BOOST_NAMESPACE {} +#endif + namespace Alepha { - inline namespace Hydrogen {} + inline namespace Hydrogen + { + #ifndef ALEPHA_OVERRIDE_BOOST_NAMESPACE + namespace boost_ns= ::boost; + #else + namespace boost_ns= ALEPHA_OVERRIDE_BOOST_NAMESPACE; + #endif + } }