|
| 1 | +// Copyright 2026 Braden Ganetsky |
| 2 | +// Distributed under the Boost Software License, Version 1.0. |
| 3 | +// https://www.boost.org/LICENSE_1_0.txt |
| 4 | + |
| 5 | +#include <boost/static_assert.hpp> |
| 6 | +#include <boost/unordered/concurrent_flat_map.hpp> |
| 7 | +#include <boost/unordered/concurrent_flat_set.hpp> |
| 8 | +#include <boost/unordered/concurrent_node_map.hpp> |
| 9 | +#include <boost/unordered/concurrent_node_set.hpp> |
| 10 | +// Don't include the FOA headers here! |
| 11 | + |
| 12 | +using c_flat_map = boost::unordered::concurrent_flat_map<int, int>; |
| 13 | +using c_flat_set = boost::unordered::concurrent_flat_set<int>; |
| 14 | +using c_node_map = boost::unordered::concurrent_node_map<int, int>; |
| 15 | +using c_node_set = boost::unordered::concurrent_node_set<int>; |
| 16 | + |
| 17 | +struct constrained_template_converter |
| 18 | +{ |
| 19 | + struct dummy |
| 20 | + { |
| 21 | + }; |
| 22 | + template <class T, typename std::enable_if< |
| 23 | + std::is_constructible<T, dummy>::value, int>::type = 0> |
| 24 | + operator T() const |
| 25 | + { |
| 26 | + return T{}; |
| 27 | + } |
| 28 | +}; |
| 29 | + |
| 30 | +// Check whether the corresponding FOA container gets instantiated. |
| 31 | +// The FOA headers aren't included, so this would fail to compile if the FOA |
| 32 | +// container was instantiated. |
| 33 | +BOOST_STATIC_ASSERT( |
| 34 | + (!std::is_constructible<c_flat_map, constrained_template_converter>::value)); |
| 35 | +BOOST_STATIC_ASSERT( |
| 36 | + (!std::is_constructible<c_flat_set, constrained_template_converter>::value)); |
| 37 | +BOOST_STATIC_ASSERT( |
| 38 | + (!std::is_constructible<c_node_map, constrained_template_converter>::value)); |
| 39 | +BOOST_STATIC_ASSERT( |
| 40 | + (!std::is_constructible<c_node_set, constrained_template_converter>::value)); |
| 41 | + |
| 42 | +int main() { return 0; } |
0 commit comments