I sincerely hope no-one takes offense to my questions, but I've
looked at the below bit of code for quite a while now, and I just
don't get it. Why? Why the below bit of wizardry? And just as
importantly, to me at least, what's _really_ going on here?

In the topaz.hh header of topaz-0.10, Chip writes:

struct null_type {
null_type() {}

template <class T>
operator T * () const { return 0; }

template <class T>
T * of() const { return 0; }

I mean, I _get_ that he's building a null type here and that
C<null_type> is later typedef'd to null. I get that. But I
haven't a clue about these templates.

I'm not a C++ guru or anything (just an ordinary mortal, struggling
to figure out the symbols of the gods :-)

Again, I apologize if my question offends the members of the list,
but I'm just unable to parse and to grok this one. (Really, I just
don't get it.)



I have sworn upon the altar of God eternal hostility against
every form of tyranny over the mind of man.
-- Thomas Jefferson, letter to Benjamin Rush, 1800 A.D.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl6-porters @
postedMar 17, '00 at 3:29p
activeMar 17, '00 at 3:29p

1 user in discussion

A. C. Yardley: 1 post



site design / logo © 2019 Grokbase