Extracted and unified default template parameter handling helpers.

The new eval_if_default helper replaces both ia_dflt_help and
ia_eval_if_default helpers. Additionally, added a new if_default
helper, which expands to the type or the default parameter directly.

The new helpers are placed in separate headers which can be used
without the iterator_adaptor template.
This commit is contained in:
Andrey Semashev
2025-02-06 01:47:43 +03:00
parent cb81a1dfc3
commit 6e60ea7a88
6 changed files with 190 additions and 124 deletions
+4 -3
View File
@@ -12,6 +12,7 @@
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/iterator/enable_if_convertible.hpp>
#include <boost/iterator/detail/eval_if_default.hpp>
#include <boost/pointee.hpp>
#include <boost/indirect_reference.hpp>
@@ -34,14 +35,14 @@ struct indirect_base
using type = iterator_adaptor<
indirect_iterator< Iter, Value, Category, Reference, Difference >,
Iter,
detail::ia_dflt_help_t<
detail::eval_if_default_t<
Value,
pointee< dereferenceable >
>,
Category,
detail::ia_dflt_help_t<
detail::eval_if_default_t<
Reference,
detail::ia_eval_if_default<
detail::eval_if_default<
Value,
indirect_reference< dereferenceable >,
std::add_lvalue_reference< Value >