Topic: type_info wish list
Author: "Philippe A. Bouchard" <philippeb@videotron.ca>
Date: Sat, 24 Aug 2002 19:50:11 GMT Raw View
Hi,
One of those would be usefull to be defined in the standard and would
help for my boost::ptr<> & other people (pretty sure):
- type_info to size_type convertions (operator [] usages);
- & typeid() global addresses that follow each other:
- & typeid(char) = 0x8000500;
- & typeid(long) = 0x8000502;
- & typeid(float) = 0x8000508;
- ...
- type of hierarchy the class belongs to:
- simple: single inheritances;
- complex: multiple inheritances;
- ambiguous: same non-virtual base class used many times.
Thank you,
Philippe A. Bouchard
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: "Noah Stein" <noah@a-c-m.org>
Date: Sun, 25 Aug 2002 13:27:01 GMT Raw View
"Philippe A. Bouchard" <philippeb@videotron.ca> wrote in message
news:ak7do4$ekj$1@news.storm.ca...
> Hi,
>
> One of those would be usefull to be defined in the standard and would
> help for my boost::ptr<> & other people (pretty sure):
>
> - type_info to size_type convertions (operator [] usages);
> - & typeid() global addresses that follow each other:
> - & typeid(char) = 0x8000500;
> - & typeid(long) = 0x8000502;
> - & typeid(float) = 0x8000508;
> - ...
That's probably a tough one. In a dynamically-linked environment, the
program usually ends up with multiple type_info blocks for some types.
type_info has an operator=() for just such a reason. Any change to support
that will certainly not have binary compatibility since some intitialization
code would be necessary in the library to support initialization of a single
global type_info array. Also, all type_info calls would have to search
through the list since the order may not be known until runtime.
-- Noah
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]