Re: Future of C++
On Aug 6, 4:47 pm, Jiang <goo.mai...@yahoo.com> wrote:
On Aug 6, 11:25 pm, Felipe Magno de Almeida
[snip]
I even found a virtual member function for some bases which
returned std::type_info. They were overriden in the derived
class.
IIRC, std::type_info is used only in OgreAny (AnyCast).
And I do not see how this example support your above
statement.
It is been like two years ago. The code was something like this:
struct base
{
virtual std::type_info& get_type() const = 0;
};
struct derived1
{
std::type_info& get_type() const { return typeid(*this); }
};
struct derived2
{
std::type_info& get_type() const { return typeid(*this); }
};
I couldn't help but laugh. Whoever wrote that didn't even
knew how typeid works.
After laughing at others, please check Boost.Any or any
other any_cast variants to make sure you understand
how typeid works.
I know very well how boost.any works and I don't know
what it has to do with what I wrote.
What I see is, well, they know C++ better than you. :-)
That's probably the case for some of them.
Jiang
--
--
Felipe Magno de Almeida
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]