Does the base function throw, if the base is not unique for the derived class object in any?

 

This condition cannot be detected at compile-time, as the dynamic type of the object in any (and therefore its ancestry relationship) is not known.
 

-----Ursprüngliche Nachricht-----
Von: Frederick Virchanza Gotham via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Mo 15.04.2024 12:45
Betreff: [std-proposals] std::any::base
An: std-proposals <std-proposals@lists.isocpp.org>;
CC: Frederick Virchanza Gotham <cauldwell.thomas@gmail.com>;
In the previous two threads entitled:

   "Extend std::type_info with more information"
   "Use the exception system to check for bases at runtime"

People were not much interested in extending "std::type_info", but
rather were particularly interested in adding a new member function to
"std::any".

Here's the beginnings of a paper for std::any::base:

   http://www.virjacode.com/papers/any_base.htm

The implementations are provided in the paper purely just to show that
it's possible without an ABI  break. Compiler vendors will implement
it much more efficiently.
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals