From 4fcc1f94401ea2b58fd8b57e3d461ec2a872211d Mon Sep 17 00:00:00 2001 From: Christoph Lehmann <christoph.lehmann@ufz.de> Date: Tue, 4 Jun 2024 08:30:46 +0200 Subject: [PATCH] [BL] Provide type aliases for better compiler error messages --- BaseLib/BoostMP11Utils.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 BaseLib/BoostMP11Utils.h diff --git a/BaseLib/BoostMP11Utils.h b/BaseLib/BoostMP11Utils.h new file mode 100644 index 00000000000..0b383bfcbeb --- /dev/null +++ b/BaseLib/BoostMP11Utils.h @@ -0,0 +1,30 @@ +/** + * \file + * \copyright + * Copyright (c) 2012-2024, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + */ + +#pragma once + +#include <boost/mp11.hpp> + +namespace boost::mp11 +{ +// Alias to be used together with static_assert to improve possible compile +// error messages. +template <typename List, typename Elem> +constexpr bool mp_contains_v = mp_contains<List, Elem>::value; + +// Alias to be used together with static_assert to improve possible compile +// error messages +template <typename Set> +constexpr bool mp_is_list_v = mp_is_list<Set>::value; + +// Alias to be used together with static_assert to improve possible compile +// error messages +template <typename Set> +constexpr bool mp_is_set_v = mp_is_set<Set>::value; +} // namespace boost::mp11 -- GitLab