Technically, yes; though (also technically) there is no gaurantee that
casting away constness will actually work the way you think it will.
Returning a char* gaurantees that the underlying storage is changeable.

Andy

On Wed, 5 Jul 2017, Michael wrote:

> Wouldn't it be better to make the default const char* and allow the user to use a const_cast<char*> to override it in those specific use cases?
>
> --
> You are receiving this because you commented.
> Reply to this email directly or view it on GitHub:
> https://github.com/xrootd/xrootd/issues/538#issuecomment-313020713


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/xrootd/xrootd","title":"xrootd/xrootd","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/xrootd/xrootd"}},"updates":{"snippets":[{"icon":"PERSON","message":"@abh3 in #538: Technically, yes; though (also technically) there is no gaurantee that \ncasting away constness will actually work the way you think it will. \nReturning a char* gaurantees that the underlying storage is changeable.\n\nAndy\n\nOn Wed, 5 Jul 2017, Michael wrote:\n\n\u003e Wouldn't it be better to make the default const char* and allow the user to use a const_cast\u003cchar*\u003e to override it in those specific use cases?\n\u003e\n\u003e -- \n\u003e You are receiving this because you commented.\n\u003e Reply to this email directly or view it on GitHub:\n\u003e https://github.com/xrootd/xrootd/issues/538#issuecomment-313020713\n"}],"action":{"name":"View Issue","url":"https://github.com/xrootd/xrootd/issues/538#issuecomment-313153451"}}}

Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1