123 return this_variant_type();
127 using this_container_type =
typename this_variant_type::container_type ;
128 DEBUG_TRACE( std::cout <<
"DEBUG search option for " <<
typeid(container_t).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
129 <<
" option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
130 <<
" check dimension ? " << check_dimension <<
" desired dimension " << dimension
132 if constexpr(std::is_same_v<this_container_type, container_t>) {
134 if constexpr(!check_dimension && countVariants<container_t>()==1) {
139 assert( (countVariants<this_container_type,N-1>()) == 0 );
140 DEBUG_TRACE( std::cout <<
"DEBUG --> for " <<
typeid(container_t).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
141 <<
" foumd unambiguous option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
148 if (this_variant_type::dimension() == dimension) {
149 DEBUG_TRACE( std::cout <<
"DEBUG --> for " <<
typeid(container_t).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
150 <<
" foumd dimension option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
156 else if constexpr(std::is_base_of_v<container_t, this_container_type>) {
158 if constexpr(std::has_virtual_destructor_v<this_container_type> && std::has_virtual_destructor_v<container_t>) {
161 const this_container_type *derived_container =
dynamic_cast<const this_container_type *
>(&
a);
162 if (derived_container) {
165 if constexpr(!check_dimension) {
169 if constexpr(countVariants<container_t,N-1>() != 0) {
173 DEBUG_TRACE( std::cout <<
"DEBUG --> for " <<
typeid(this_container_type).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
174 <<
" foumd derived option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
180 if (this_variant_type::dimension() == dimension) {
181 DEBUG_TRACE( std::cout <<
"DEBUG --> for " <<
typeid(this_container_type).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
182 <<
" derived with dimension option: " <<
N <<
" " <<
typeid(this_container_type).
name()
183 <<
" dim " << this_variant_type::dimension()