Re: Null<unsigned>

Posted by Luigi Ballabio-4 on
URL: http://quantlib.414.s1.nabble.com/Null-unsigned-tp2038p2039.html

At 03:35 PM 5/5/02 -0500, Vadim Ogranovich wrote:
>There is no specialization of Null<unsigned>. Is it by design?

No, it is just that we didn't need it yet. Kind of sloppy on me :(
We should provide specializations for the other built-ins.

>It is confusing as Null<unsigned>() produces 0 on my machine (g++ v3.x), and
>this is completely compiler specific.

Not entirely computer-specific, I think.
     return unsigned();
should give you 0 no matter what. But anyway, we should specialize that.

>Another question is why the code below is contingent on defined(__DOXYGEN__)
>?
>
>    #if !defined(__DOXYGEN__)
>     template <>
>     class Null<int> {
>       public:
>         Null() {}
>         operator int() const { return QL_MAX_INT; }
>     };
>
>     template <>
>     class Null<double> {
>       public:
>         Null() {}
>         operator double() const { return QL_MAX_DOUBLE; }
>     };
>     #endif

I just wanted the above not to appear in the Doxygen-generated
documentation as it would have been redundant---only the returned value is
specialized, not the interface which is the thing Doxygen documents.

Bye,
         Luigi