Translate C++ to D

Luca Lupo luca.lupo at hotmail.it
Fri Jan 11 07:24:24 PST 2008


Thanks,
So in this way?

//Observer.d

import std.stdio;
import std.string;
import Subject

class Observer{
      ~this(){} //distructor for observer
      
       this(){} // costructor for observer
       
       Update(Subject* b){}
       }

class Subscriber{
      Update(Subject* b);
      }

class SubscriberG{
      this (string a){
           indirizzo_e_mail_G = a;
           }
      
      Update (Subject* b){
             cout<<"Subscriber tipo G->"<<"Name blog: "<<((Blog *)b).GetName()<<endl;
             ((Blog *)b).GetTitle();
             ((Blog *)b).GetLine();
             cout<<"Autore Ultimo Post :"<<((Blog *)b).GetAuthor();
             cout<<endl<<endl;
             }
      }
      
class SubscriberS{
      this (string a, string b){
           indirizzo_e_mail_S = a;
           name_author = b;
           }

      Update (Subject* b){
             if (name_author == ((Blog *)b).GetAuthor()){
                cout<<"Subscriber tipo S->"<<"Name blog: "<<((Blog *)b).GetName()<<endl;
                ((Blog *)b).GetTitle();
                ((Blog *)b).GetText();
                cout<<"Autore Ultimo Post :"<<((Blog *)b).GetAuthor();
                }
             cout<<endl<<endl;
             }
      }




but is possibile import the standard library of cpp so I can use cout?

Thanks



More information about the Digitalmars-d mailing list