>Please define the interfaces that you want to be SP-free!

I'm with Hiram ... I think the entire API should be SP-free.  The less
the users have to see SPs, the better.


>>It's all about the user and helping them come up to speed and use the
api
>>as quickly and painlessly as possible.  I understand that in these
cases
>>you're passing a pointer and not copying, but it complicates the user
>>interface when the person just wants to pass in a string.  They
shouldn't
>>have to create a string on the heap an then wrap it in a smart pointer
to
>>just call a function.

>Just a quick note, this is not necessary with the current design of
>accepting "const char*" and returning p<string>. The user can easily
>extract the const char from the SP string if wanted. 
>

But then you lose the symmetry of the getters and setters ... the setter
should take the same type that the getter returns.  IMHO, it seems
strange to have the setter take a char* and then the getter returns a
smart pointer.

>>Class Xxx {
>>  std::string name;
>>  void setName (const std::string& name) {
>>    this->name = name;
>>  }
>>  const std::string& getName () const {
>>    return this->name;
>>  }
>>};
>
>Shall we agree on the one above?
>
>Regards,
>Mats & David

Regards,
Nate

Reply via email to