From: mailbox@dmitry-kazakov.de   
      
   On Wed, 07 Feb 2007 17:03:34 +0100, Seweryn Habdank-Wojewódzki wrote:   
      
   > Dmitry A. Kazakov wrote:   
   >   
   >> On Mon, 05 Feb 2007 00:31:58 +0100, Seweryn Habdank-Wojewódzki wrote:   
   >>   
   >>> Dmitry A. Kazakov wrote:   
   >>>   
   >> Why? The question we consider is when   
   >>   
   >> Bar(X : Numeric)   
   >>   
   >> is better than   
   >>   
   >> Bar (X ; Numeric'Class);   
   >>   
   >> Implementation is irrelevant and it will barely differ in both cases. A   
   >> sufficient difference is that the latter is a proper procedure and the   
   >> former is template to be instantiated for each member of Numeric'Class.   
   >   
   > And? I understand that you want to say that I will have a problem when there   
   > will by inheritance and there I will have a trouble with taking proper   
   > virtual function. Yes, you are right, but I do not want to force static   
   > case to be dynamic. I never said like that.   
      
   No, it is not a virtual function and it never will be overridden. A   
   class-wide function cannot be overridden, it is exactly same   
   (contravariant) for all members of the class (=derived types).   
      
   >> Member = element of the set. Ti is a member of {T, T1, T2, ...}   
   >   
   > I do not see any implementation?   
      
   It is not an implementation. It is a definition of what is a class [of   
   types].   
      
   > For mr all that has no clear formulation of   
   > the problem. What is that mean ti is a member of ... This is set of what?   
      
   Of types.   
      
   class T {...};   
   class T1 : public T {...};   
   class T2 : public T {...};   
   class T3 : public T1 {...};   
   ...   
      
   [ "class T {...};" in C++ is the definition of a type named T together with   
   its class rooted in T, which is also named T, as well as the namespace,   
   also named T (otherwise C++ weren't such a joy, right? (:-)). The choice of   
   the keyword "class" was rather unfortunate, but it is too late to change. ]   
      
   Meta programming is about sets of types. In class-wide (OO) approach sets   
   of types are limited to classes (= types sets closed upon derivation). In   
   template approach sets of types are limited to statically known ad-hoc   
   types sets mentioned in instantiations. Generics (templates with contracts)   
   are less chaotic than raw templates, and less powerful, BTW.   
      
   >> The consequence of this is that there exist good chances that the   
   >> representations will be unknown until run-time and required dynamic   
   >> switching.   
   >   
   > And?   
      
   => it cannot be switched by a template parameter.   
      
   --   
   Regards,   
   Dmitry A. Kazakov   
   http://www.dmitry-kazakov.de   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|