diff --git a/example/metall_containers.cpp b/example/metall_containers.cpp index c1077f82..1ab379d6 100644 --- a/example/metall_containers.cpp +++ b/example/metall_containers.cpp @@ -16,6 +16,18 @@ #include #include +// Boost 1.81 or later is required +#if BOOST_VERSION >= 108100 +#include +#include +#endif + +// Boost 1.82 or later is required +#if BOOST_VERSION >= 108200 +#include +#include +#endif + using namespace metall; namespace mc = metall::container; @@ -33,7 +45,8 @@ int main() { mg.construct>("set")(mg.get_allocator()); mg.construct>("multiset")(mg.get_allocator()); - mg.construct>("umap")(mg.get_allocator()); + mg.construct>("unordered_map")( + mg.get_allocator()); mg.construct>("unordered_multimap")( mg.get_allocator()); @@ -41,6 +54,20 @@ int main() { mg.construct>("unordered_multiset")( mg.get_allocator()); +#if BOOST_VERSION >= 108100 + mg.construct>("unordered_flat_map")( + mg.get_allocator()); + mg.construct>("unordered_flat_set")( + mg.get_allocator()); +#endif + +#if BOOST_VERSION >= 108200 + mg.construct>("unordered_node_map")( + mg.get_allocator()); + mg.construct>("unordered_node_set")( + mg.get_allocator()); +#endif + mg.construct>("vector")(mg.get_allocator()); mg.construct>("stack")(mg.get_allocator()); diff --git a/include/metall/container/unordered_flat_map.hpp b/include/metall/container/unordered_flat_map.hpp new file mode 100644 index 00000000..ecca824c --- /dev/null +++ b/include/metall/container/unordered_flat_map.hpp @@ -0,0 +1,28 @@ +// Copyright 2023 Lawrence Livermore National Security, LLC and other Metall +// Project Developers. See the top-level COPYRIGHT file for details. +// +// SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#ifndef METALL_CONTAINER_UNORDERED_FLAT_MAP_HPP +#define METALL_CONTAINER_UNORDERED_FLAT_MAP_HPP + +#include + +static_assert(BOOST_VERSION >= 108100, "Unsupported Boost version"); +#include + +#include + +namespace metall::container { + +/// \brief An unordered_flat_map container that uses Metall as its default +/// allocator. +template , + class KeyEqual = std::equal_to, + class Allocator = manager::allocator_type>> +using unordered_flat_map = + boost::unordered_flat_map; + +} // namespace metall::container + +#endif // METALL_CONTAINER_UNORDERED_FLAT_MAP_HPP diff --git a/include/metall/container/unordered_flat_set.hpp b/include/metall/container/unordered_flat_set.hpp new file mode 100644 index 00000000..24c63264 --- /dev/null +++ b/include/metall/container/unordered_flat_set.hpp @@ -0,0 +1,28 @@ +// Copyright 2023 Lawrence Livermore National Security, LLC and other Metall +// Project Developers. See the top-level COPYRIGHT file for details. +// +// SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#ifndef METALL_CONTAINER_UNORDERED_FLAT_SET_HPP +#define METALL_CONTAINER_UNORDERED_FLAT_SET_HPP + +#include + +static_assert(BOOST_VERSION >= 108100, "Unsupported Boost version"); +#include + +#include + +namespace metall::container { + +/// \brief An unordered_flat_set container that uses Metall as its default +/// allocator. +template , + class KeyEqual = std::equal_to, + class Allocator = manager::allocator_type> +using unordered_flat_set = + boost::unordered_flat_set; + +} // namespace metall::container + +#endif // METALL_CONTAINER_UNORDERED_FLAT_SET_HPP diff --git a/include/metall/container/unordered_node_map.hpp b/include/metall/container/unordered_node_map.hpp new file mode 100644 index 00000000..07af8ea8 --- /dev/null +++ b/include/metall/container/unordered_node_map.hpp @@ -0,0 +1,28 @@ +// Copyright 2023 Lawrence Livermore National Security, LLC and other Metall +// Project Developers. See the top-level COPYRIGHT file for details. +// +// SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#ifndef METALL_CONTAINER_UNORDERED_NODE_MAP_HPP +#define METALL_CONTAINER_UNORDERED_NODE_MAP_HPP + +#include + +static_assert(BOOST_VERSION >= 108200, "Unsupported Boost version"); +#include + +#include + +namespace metall::container { + +/// \brief An unordered_node_map container that uses Metall as its default +/// allocator. +template , + class KeyEqual = std::equal_to, + class Allocator = manager::allocator_type>> +using unordered_node_map = + boost::unordered_node_map; + +} // namespace metall::container + +#endif // METALL_CONTAINER_UNORDERED_NODE_MAP_HPP diff --git a/include/metall/container/unordered_node_set.hpp b/include/metall/container/unordered_node_set.hpp new file mode 100644 index 00000000..2616a12e --- /dev/null +++ b/include/metall/container/unordered_node_set.hpp @@ -0,0 +1,28 @@ +// Copyright 2023 Lawrence Livermore National Security, LLC and other Metall +// Project Developers. See the top-level COPYRIGHT file for details. +// +// SPDX-License-Identifier: (Apache-2.0 OR MIT) + +#ifndef METALL_CONTAINER_UNORDERED_NODE_SET_HPP +#define METALL_CONTAINER_UNORDERED_NODE_SET_HPP + +#include + +static_assert(BOOST_VERSION >= 108200, "Unsupported Boost version"); +#include + +#include + +namespace metall::container { + +/// \brief An unordered_node_set container that uses Metall as its default +/// allocator. +template , + class KeyEqual = std::equal_to, + class Allocator = manager::allocator_type> +using unordered_node_set = + boost::unordered_node_set; + +} // namespace metall::container + +#endif // METALL_CONTAINER_UNORDERED_NODE_SET_HPP