120 return this_variant_type();
124 using this_container_type =
typename this_variant_type::container_type ;
125 DEBUG_TRACE( std::cout <<
"DEBUG search option for " <<
typeid(container_t).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
126 <<
" option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
127 <<
" check dimension ? " << check_dimension <<
" desired dimension " << dimension
129 if constexpr(std::is_same_v<this_container_type, container_t>) {
131 if constexpr(!check_dimension && countVariants<container_t>()==1) {
136 assert( (countVariants<this_container_type,N-1>()) == 0 );
137 DEBUG_TRACE( std::cout <<
"DEBUG --> for " <<
typeid(container_t).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
138 <<
" foumd unambiguous option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
145 if (this_variant_type::dimension() == dimension) {
146 DEBUG_TRACE( std::cout <<
"DEBUG --> for " <<
typeid(container_t).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
147 <<
" foumd dimension option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
153 else if constexpr(std::is_base_of_v<container_t, this_container_type>) {
155 if constexpr(std::has_virtual_destructor_v<this_container_type> && std::has_virtual_destructor_v<container_t>) {
158 const this_container_type *derived_container =
dynamic_cast<const this_container_type *
>(&
a);
159 if (derived_container) {
162 if constexpr(!check_dimension) {
166 if constexpr(countVariants<container_t,N-1>() != 0) {
170 DEBUG_TRACE( std::cout <<
"DEBUG --> for " <<
typeid(this_container_type).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
171 <<
" foumd derived option: " <<
N <<
" " <<
typeid(this_container_type).
name() <<
" dim " << this_variant_type::dimension()
177 if (this_variant_type::dimension() == dimension) {
178 DEBUG_TRACE( std::cout <<
"DEBUG --> for " <<
typeid(this_container_type).
name() <<
" (aka " <<
typeid(
a).
name() <<
")"
179 <<
" derived with dimension option: " <<
N <<
" " <<
typeid(this_container_type).
name()
180 <<
" dim " << this_variant_type::dimension()