Re: C++ templates

From: msevior_at_physics.unimelb.edu.au
Date: Thu Mar 11 2004 - 13:06:01 EST

  • Next message: Hubert Figuiere: "Re: C++ templates"

    > Hi,
    >
    > I'm about to change UT_Vector to use C++ template. The patch will be
    > huge and is about to break all the platforms (I'll handle Unix and MacOS
    > X).
    > The idea is to use UT_GenericVector as a template class, UT_Vector being
    > a UT_GenericVector<void*>.
    >
    > Why am I doing that ?
    > Because there is a lot of casting madness while these allow enforcing a
    > stronger type checking.
    >
    > I was wondering whether anyone had any objection.
    >

    Can an MSVC developer test a fraction of what you attempt first?

    There is folklore that says MSVC doesn't do templates. I just want to be
    sure before you launch into this.

    But as a general point I really like the idea. C++ is a type-safe
    language. It sucks that we spend so much effort deliberately not using
    this feature because we cast to void * for vectors.

    Plus I'm sick of all those static casts from getNthItem(i)....

    Martin

    > If that is OK, then I'll templatize UT_Stack.
    >
    > Hub
    >
    >



    This archive was generated by hypermail 2.1.4 : Thu Mar 11 2004 - 13:07:42 EST