Loading ...
Sorry, an error occurred while loading the content.

Re: [XP] Re: C# generics [Was: Guard clauses]

Expand Messages
  • Bill Kelly
    From: Ian Collins ... Yep... D: tree windows XXX YYY telnet.cpp(191) : error C2664: class std::_Tree
    Message 1 of 11 , Dec 5, 2002
    • 0 Attachment
      From: "Ian Collins" <ian@...>

      > Phlip wrote:
      >
      > >You missunderstand the point. "Pointers to functions" is virtual dispatch in
      > >C. OO languages support run-time binding, relatively typesafely.
      > >
      > >
      > I didn't so much miss the point and disagree with it.
      >
      > The fact that a language supports run time binding doesn't make it a
      > good thing, rather it adds a veneer of respectability to a smell. If
      > you use it, you have to test it and handle the exception conditions that
      > may arise form its use. Language support gives the unwary a false sense
      > of security.
      >
      > Sticking to static type checking lets the compiler do the work for you.
      > It keeps things simple.

      Yep...

      D:\tree\windows\XXX\YYY\telnet.cpp(191) : error C2664: 'class std::_Tree<
      enum Telnet::OptionId,struct std::pair<enum Telnet::OptionId const ,struc
      t std::pair<bool (__thiscall Telnet::*)(enum Telnet::Verb,enum Telnet::Op
      tionId),bool (__thiscall Telnet::*)(unsigned char)> >,struct std::map<enu
      m Telnet::OptionId,struct std::pair<bool (__thiscall Telnet::*)(enum Teln
      et::Verb,enum Telnet::OptionId),bool (__thiscall Telnet::*)(unsigned char
      )>,struct std::less<enum Telnet::OptionId>,class std::allocator<struct st
      d::pair<bool (__thiscall Telnet::*)(enum Telnet::Verb,enum Telnet::Option
      Id),bool (__thiscall Telnet::*)(unsigned char)> > >::_Kfn,struct std::les
      s<enum Telnet::OptionId>,class std::allocator<struct std::pair<bool (__th
      iscall Telnet::*)(enum Telnet::Verb,enum Telnet::OptionId),bool (__thisca
      ll Telnet::*)(unsigned char)> > >::iterator __thiscall std::map<enum Teln
      et::OptionId,struct std::pair<bool (__thiscall Telnet::*)(enum Telnet::Ve
      rb,enum Telnet::OptionId),bool (__thiscall Telnet::*)(unsigned char)>,str
      uct std::less<enum Telnet::OptionId>,class std::allocator<struct std::pai
      r<bool (__thiscall Telnet::*)(enum Telnet::Verb,enum Telnet::OptionId),bo
      ol (__thiscall Telnet::*)(unsigned char)> > >::insert(class std::_Tree<en
      um Telnet::OptionId,struct std::pair<enum Telnet::OptionId const ,struct
      std::pair<bool (__thiscall Telnet::*)(enum Telnet::Verb,enum Telnet::Opti
      onId),bool (__thiscall Telnet::*)(unsigned char)> >,struct std::map<enum
      Telnet::OptionId,struct std::pair<bool (__thiscall Telnet::*)(enum Telnet
      ::Verb,enum Telnet::OptionId),bool (__thiscall Telnet::*)(unsigned char)>
      ,struct std::less<enum Telnet::OptionId>,class std::allocator<struct std:
      :pair<bool (__thiscall Telnet::*)(enum Telnet::Verb,enumTelnet::OptionId)
      ,bool (__thiscall Telnet::*)(unsigned char)> > >::_Kfn,struct std::less<e
      num Telnet::OptionId>,class std::allocator<struct std::pair<bool (__thisc
      all Telnet::*)(enum Telnet::Verb,enum Telnet::OptionId),bool (__thiscall
      Telnet::*)(unsigned char)> > >::iterator,const struct std::pair<enum Teln
      et::OptionId const ,struct std::pair<bool (__thiscall Telnet::*)(enum Tel
      net::Verb,enum Telnet::OptionId),bool (__thiscall Telnet::*)(unsigned cha
      r)> > &)' : cannot convert parameter 1 from 'enum Telnet::OptionId' to 'c
      lass std::_Tree<enum Telnet::OptionId,struct std::pair<enum Telnet::Optio
      nId const ,struct std::pair<bool (__thiscall Telnet::*)(enum Telnet::Verb
      ,enum Telnet::OptionId),bool (__thiscall Telnet::*)(unsigned char)> >,str
      uct std::map<enum Telnet::OptionId,struct std::pair<bool (__thiscall Teln
      et::*)(enum Telnet::Verb,enum Telnet::OptionId),bool (__thiscall Telnet::
      *)(unsigned char)>,struct std::less<enum Telnet::OptionId>,class std::all
      ocator<struct std::pair<bool (__thiscall Telnet::*)(enum Telnet::Verb,enu
      m Telnet::OptionId),bool (__thiscall Telnet::*)(unsigned char)> > >::_Kfn
      ,struct std::less<enum Telnet::OptionId>,class std::allocator<struct std:
      :pair<bool (__thiscall Telnet::*)(enum Telnet::Verb,enum Telnet::OptionId
      ),bool (__thiscall Telnet::*)(unsigned char)> > >::iterator'
      No constructor could take the source type, or constructor overload
      resolution was ambiguous


      Simplicity incarnate. ;-D


      My experience has been, although it's harder and takes longer to write
      programs in a statically typed language, these programs are just about
      as bug-free as the programs I write in dynamically typed languages.

      So I kindof tend to view static typing is a bitter practical joke
      perpetrated by language designers who seem to have out-clevered
      themselves selling their souls to try to find a way to catch a few
      more typos.... and damn the cost! (As though any torture resultant
      were somehow "worth it"...)

      But then, I don't develop space shuttle or pacemaker software. :)


      Regards,

      Bill "now the static vs. dynamic binding *speed* argument, that's different" Kelly
    Your message has been successfully submitted and would be delivered to recipients shortly.