Re: Smart char * class...

From: Christopher Benson-Manica (ataru_at_nospam.cyberspace.org)
Date: 08/20/04


Date: Fri, 20 Aug 2004 20:00:37 +0000 (UTC)

Victor Bazarov <v.Abazarov@comacast.net> spoke thus:

> Could you maybe explain why it's not an option?

My boss doesn't like them, and all the code expects char *'s, and none
of it catches std::exception, so...

> No. Passing an object to a function with variable number of arguments
> is undefined. So, printf is not going to work unless you define one
> more member function of 'char_ptr', 'operator const char*':

Ah, that's what I wanted! :)

> Also, your class is defective: it is missing a copy constructor, which
> you have to have according to the "Rule of Three".

That was *also* what I wanted, excellent!

> Keep adding functionality to your class until you get it right. Then
> see which functionality you don't need, and get rid of it.

Will do, thanks!

-- 
Christopher Benson-Manica  | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org    | don't, I need to know.  Flames welcome.


Relevant Pages

  • Re: ZX latest
    ... Called the tyre place this morning and spoke to the boss, ... to put it through their insurance or not. ...
    (uk.rec.motorcycles)
  • Re: Crawling from the Cocoon
    ... courage to call work later. ... Right now, I'm bricking it. ... Spoke to Boss. ...
    (uk.people.support.depression)
  • Re: template specialization problem, but only with char*
    ... Victor Bazarov wrote: ... > Adam wrote: ... > 'const' relates to the object, ... typedef char* Char; ...
    (comp.lang.cpp)
  • Re: int or char for area code and phone number
    ... My first arguement is that I dont want character data in there. ... I would just use CHAR; you won't be doing any calculation on ... >> boss and I were having a debate about using int or char for these type ...
    (microsoft.public.sqlserver.server)
  • Re: HAHAHAHA
    ... John Harrison spoke thus: ... > them that what they have is rubbish? ... I mentioned it to my boss, and he said that he was aware of that ...
    (comp.lang.cpp)